🐎 Cache pixel positions

This commit is contained in:
Antonio Scandurra
2015-09-30 16:15:49 +02:00
parent 59d6974f89
commit bb709f58d9
2 changed files with 27 additions and 14 deletions

View File

@@ -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) ->