mirror of
https://github.com/atom/atom.git
synced 2026-02-17 01:51:54 -05:00
🐎 Cache pixel positions
This commit is contained in:
@@ -560,7 +560,7 @@ class TextEditorComponent
|
||||
handleStylingChange: =>
|
||||
@sampleFontStyling()
|
||||
@sampleBackgroundColors()
|
||||
@presenter.characterWidthsChanged()
|
||||
@invalidateCharacterWidths()
|
||||
|
||||
handleDragUntilMouseUp: (dragHandler) =>
|
||||
dragging = false
|
||||
@@ -823,7 +823,7 @@ class TextEditorComponent
|
||||
setFontSize: (fontSize) ->
|
||||
@getTopmostDOMNode().style.fontSize = fontSize + 'px'
|
||||
@sampleFontStyling()
|
||||
@presenter.characterWidthsChanged()
|
||||
@invalidateCharacterWidths()
|
||||
|
||||
getFontFamily: ->
|
||||
getComputedStyle(@getTopmostDOMNode()).fontFamily
|
||||
@@ -831,11 +831,15 @@ class TextEditorComponent
|
||||
setFontFamily: (fontFamily) ->
|
||||
@getTopmostDOMNode().style.fontFamily = fontFamily
|
||||
@sampleFontStyling()
|
||||
@presenter.characterWidthsChanged()
|
||||
@invalidateCharacterWidths()
|
||||
|
||||
setLineHeight: (lineHeight) ->
|
||||
@getTopmostDOMNode().style.lineHeight = lineHeight
|
||||
@sampleFontStyling()
|
||||
@invalidateCharacterWidths()
|
||||
|
||||
invalidateCharacterWidths: ->
|
||||
@linesYardstick.invalidateCache()
|
||||
@presenter.characterWidthsChanged()
|
||||
|
||||
setShowIndentGuide: (showIndentGuide) ->
|
||||
|
||||
Reference in New Issue
Block a user