mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge pull request #11388 from ypresto/fix-text-editor-window-size
🐛 Fix window size is not updated on resize
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -757,6 +757,7 @@ class TextEditorComponent
|
||||
pollDOM: =>
|
||||
unless @checkForVisibilityChange()
|
||||
@sampleBackgroundColors()
|
||||
@measureWindowSize()
|
||||
@measureDimensions()
|
||||
@sampleFontStyling()
|
||||
@overlayManager?.measureOverlays()
|
||||
|
||||
Reference in New Issue
Block a user