Fix correction panel size calculation
This commit is contained in:
parent
e2cb4b95e3
commit
9c869a2897
23
service.js
23
service.js
@ -323,24 +323,19 @@ class BesService {
|
||||
*/
|
||||
setCorrectionPanelSize() {
|
||||
const styles = window.getComputedStyle(this.textElement)
|
||||
const totalWidth =
|
||||
parseFloat(styles.paddingLeft) +
|
||||
parseFloat(styles.marginLeft) +
|
||||
parseFloat(styles.width) +
|
||||
parseFloat(styles.marginRight) +
|
||||
parseFloat(styles.paddingRight)
|
||||
const totalHeight =
|
||||
parseFloat(styles.paddingTop) +
|
||||
parseFloat(styles.marginTop) +
|
||||
parseFloat(styles.height) +
|
||||
parseFloat(styles.marginBottom) +
|
||||
parseFloat(styles.paddingBottom)
|
||||
this.correctionPanel.style.width = `${totalWidth}px`
|
||||
this.correctionPanel.style.height = `${totalHeight}px`
|
||||
|
||||
this.correctionPanel.style.width = styles.width
|
||||
this.correctionPanel.style.marginLeft = styles.marginLeft
|
||||
this.correctionPanel.style.marginRight = styles.marginRight
|
||||
this.correctionPanel.style.paddingLeft = styles.paddingLeft
|
||||
this.correctionPanel.style.paddingRight = styles.paddingRight
|
||||
this.scrollPanel.style.width = `${this.textElement.scrollWidth}px`
|
||||
|
||||
this.correctionPanel.style.height = styles.height
|
||||
this.correctionPanel.style.marginTop = styles.marginTop
|
||||
this.correctionPanel.style.marginBottom = styles.marginBottom
|
||||
this.correctionPanel.style.paddingTop = styles.paddingTop
|
||||
this.correctionPanel.style.paddingBottom = styles.paddingBottom
|
||||
this.scrollPanel.style.height = `${this.textElement.scrollHeight}px`
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user