Merge pull request #11388 from ypresto/fix-text-editor-window-size

🐛 Fix window size is not updated on resize
This commit is contained in:
Nathan Sobo
2016-08-06 07:07:30 -06:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -2251,6 +2251,17 @@ describe('TextEditorComponent', function () {
expect(overlay.style.left).toBe(windowWidth - itemWidth + 'px')
expect(overlay.style.top).toBe(position.top + editor.getLineHeightInPixels() + 'px')
// window size change
windowWidth = Math.round(gutterWidth + 29 * editor.getDefaultCharWidth())
await atom.setWindowDimensions({
width: windowWidth,
height: windowHeight,
})
atom.views.performDocumentPoll()
expect(overlay.style.left).toBe(windowWidth - itemWidth + 'px')
expect(overlay.style.top).toBe(position.top + editor.getLineHeightInPixels() + 'px')
})
})
})

View File

@@ -757,6 +757,7 @@ class TextEditorComponent
pollDOM: =>
unless @checkForVisibilityChange()
@sampleBackgroundColors()
@measureWindowSize()
@measureDimensions()
@sampleFontStyling()
@overlayManager?.measureOverlays()