mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
When font size changes, correctly adjust scrollable height
This requires updating the padding of the rendered lines and then adjusting the vertical scrollbar content height before updating any of the rendered lines. This fixes (hopefully all of) the rendering issues when adjusting the font size.
This commit is contained in:
@@ -493,6 +493,8 @@ describe "Editor", ->
|
||||
expect(editor.lineHeight).toBeGreaterThan lineHeightBefore
|
||||
expect(editor.charWidth).toBeGreaterThan charWidthBefore
|
||||
expect(editor.getCursorView().position()).toEqual { top: 5 * editor.lineHeight, left: 6 * editor.charWidth }
|
||||
expect(editor.renderedLines.outerHeight()).toBe buffer.getLineCount() * editor.lineHeight
|
||||
expect(editor.verticalScrollbarContent.height()).toBe buffer.getLineCount() * editor.lineHeight
|
||||
|
||||
# ensure we clean up font size subscription
|
||||
editor.trigger('core:close')
|
||||
|
||||
@@ -572,6 +572,8 @@ class Editor extends View
|
||||
if fontSize?
|
||||
@css('font-size', fontSize + 'px')
|
||||
@calculateDimensions()
|
||||
@updatePaddingOfRenderedLines()
|
||||
@handleScrollHeightChange()
|
||||
@updateCursorViews()
|
||||
@updateRenderedLines()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user