mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Update selection rendering when font size changes
This commit is contained in:
@@ -501,6 +501,18 @@ describe "Editor", ->
|
||||
rootView.setFontSize(22)
|
||||
expect(editor.css('font-size')).toBe '30px'
|
||||
|
||||
it "updates the position and size of selection regions", ->
|
||||
rootView.attachToDom()
|
||||
rootView.setFontSize(10)
|
||||
editor.setSelectedBufferRange([[5, 2], [5, 7]])
|
||||
|
||||
rootView.setFontSize(30)
|
||||
selectionRegion = editor.find('.selection')
|
||||
expect(selectionRegion.position().top).toBe 5 * editor.lineHeight
|
||||
expect(selectionRegion.position().left).toBe 2 * editor.charWidth
|
||||
expect(selectionRegion.height()).toBe editor.lineHeight
|
||||
expect(selectionRegion.width()).toBe 5 * editor.charWidth
|
||||
|
||||
it "updates the gutter width and font size", ->
|
||||
rootView.attachToDom()
|
||||
originalFontSize = rootView.getFontSize()
|
||||
|
||||
@@ -575,6 +575,7 @@ class Editor extends View
|
||||
@updatePaddingOfRenderedLines()
|
||||
@handleScrollHeightChange()
|
||||
@updateCursorViews()
|
||||
@updateSelectionViews()
|
||||
@updateRenderedLines()
|
||||
|
||||
newSplitEditor: ->
|
||||
@@ -668,6 +669,10 @@ class Editor extends View
|
||||
for cursorView in @getCursorViews()
|
||||
cursorView.updateAppearance()
|
||||
|
||||
updateSelectionViews: ->
|
||||
for selectionView in @getSelectionViews()
|
||||
selectionView.updateAppearance()
|
||||
|
||||
syncCursorAnimations: ->
|
||||
for cursorView in @getCursorViews()
|
||||
do (cursorView) -> cursorView.resetCursorAnimation()
|
||||
|
||||
Reference in New Issue
Block a user