diff --git a/service.js b/service.js index ae038aa..d95f793 100644 --- a/service.js +++ b/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` }