🔥 🎉 Remove scoped character width

This commit is contained in:
Antonio Scandurra
2015-09-29 17:32:20 +02:00
parent 123594dbbf
commit 72093da1a7
5 changed files with 2 additions and 174 deletions

View File

@@ -30,7 +30,6 @@ class TextEditorComponent
inputEnabled: true
measureScrollbarsWhenShown: true
measureLineHeightAndDefaultCharWidthWhenShown: true
remeasureCharacterWidthsWhenShown: false
stylingChangeAnimationFrameRequested: false
gutterComponent: null
mounted: true
@@ -169,7 +168,6 @@ class TextEditorComponent
@updateParentViewMiniClass()
readAfterUpdateSync: =>
@linesComponent.measureCharactersInNewLines() if @isVisible() and not @newState.content.scrollingVertically
@overlayManager?.measureOverlays()
mountGutterContainerComponent: ->
@@ -184,7 +182,6 @@ class TextEditorComponent
@measureWindowSize()
@measureDimensions()
@measureLineHeightAndDefaultCharWidth() if @measureLineHeightAndDefaultCharWidthWhenShown
@remeasureCharacterWidths() if @remeasureCharacterWidthsWhenShown
@editor.setVisible(true)
@performedInitialMeasurement = true
@updatesPaused = false
@@ -563,7 +560,6 @@ class TextEditorComponent
handleStylingChange: =>
@sampleFontStyling()
@sampleBackgroundColors()
@remeasureCharacterWidths()
handleDragUntilMouseUp: (dragHandler) =>
dragging = false
@@ -712,15 +708,14 @@ class TextEditorComponent
oldFontFamily = @fontFamily
oldLineHeight = @lineHeight
@presenter.characterWidthsChanged()
{@fontSize, @fontFamily, @lineHeight} = getComputedStyle(@getTopmostDOMNode())
if @fontSize isnt oldFontSize or @fontFamily isnt oldFontFamily or @lineHeight isnt oldLineHeight
@clearPoolAfterUpdate = true
@measureLineHeightAndDefaultCharWidth()
if (@fontSize isnt oldFontSize or @fontFamily isnt oldFontFamily) and @performedInitialMeasurement
@remeasureCharacterWidths()
sampleBackgroundColors: (suppressUpdate) ->
{backgroundColor} = getComputedStyle(@hostElement)
@@ -738,13 +733,6 @@ class TextEditorComponent
else
@measureLineHeightAndDefaultCharWidthWhenShown = true
remeasureCharacterWidths: ->
if @isVisible()
@remeasureCharacterWidthsWhenShown = false
@linesComponent.remeasureCharacterWidths()
else
@remeasureCharacterWidthsWhenShown = true
measureScrollbars: ->
@measureScrollbarsWhenShown = false