diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index c744ce795..3432a0fea 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -104,7 +104,7 @@ describe('TextEditorComponent', () => { { expect(editor.getApproximateLongestScreenRow()).toBe(3) - const expectedWidth = Math.round( + const expectedWidth = Math.ceil( component.pixelPositionForScreenPosition(Point(3, Infinity)).left + component.getBaseCharacterWidth() ) @@ -121,7 +121,7 @@ describe('TextEditorComponent', () => { // Capture the width of the lines before requesting the width of // longest line, because making that request forces a DOM update const actualWidth = element.querySelector('.lines').style.width - const expectedWidth = Math.round( + const expectedWidth = Math.ceil( component.pixelPositionForScreenPosition(Point(6, Infinity)).left + component.getBaseCharacterWidth() ) @@ -3980,7 +3980,7 @@ describe('TextEditorComponent', () => { // Capture the width of the lines before requesting the width of // longest line, because making that request forces a DOM update const actualWidth = element.querySelector('.lines').style.width - const expectedWidth = Math.round( + const expectedWidth = Math.ceil( component.pixelPositionForScreenPosition(Point(3, Infinity)).left + component.getBaseCharacterWidth() ) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 855920b3b..c88aab304 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -2694,7 +2694,7 @@ class TextEditorComponent { } getContentWidth () { - return Math.round(this.getLongestLineWidth() + this.getBaseCharacterWidth()) + return Math.ceil(this.getLongestLineWidth() + this.getBaseCharacterWidth()) } getScrollContainerClientWidthInBaseCharacters () {