mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
🐎 Remove rows to measure in the next frame
This commit is contained in:
@@ -17,6 +17,9 @@ class LinesYardstick
|
||||
@presenter.setScreenRowsToMeasure(screenRows)
|
||||
@lineNodesProvider.updateSync(@presenter.getPreMeasurementState())
|
||||
|
||||
clearScreenRowsForMeasurement: ->
|
||||
@presenter.clearScreenRowsToMeasure()
|
||||
|
||||
screenPositionForPixelPosition: (pixelPosition) ->
|
||||
targetTop = pixelPosition.top
|
||||
targetLeft = pixelPosition.left
|
||||
@@ -75,6 +78,8 @@ class LinesYardstick
|
||||
previousColumn = column
|
||||
column += charLength
|
||||
|
||||
@clearScreenRowsForMeasurement()
|
||||
|
||||
if targetLeft <= previousLeft + (charWidth / 2)
|
||||
new Point(row, previousColumn)
|
||||
else
|
||||
@@ -92,6 +97,8 @@ class LinesYardstick
|
||||
top = targetRow * @model.getLineHeightInPixels()
|
||||
left = @leftPixelPositionForScreenPosition(targetRow, targetColumn)
|
||||
|
||||
@clearScreenRowsForMeasurement()
|
||||
|
||||
{top, left}
|
||||
|
||||
leftPixelPositionForScreenPosition: (row, column) ->
|
||||
|
||||
@@ -395,6 +395,12 @@ class TextEditorPresenter
|
||||
@shouldUpdateLineNumbersState = true
|
||||
@shouldUpdateDecorations = true
|
||||
|
||||
clearScreenRowsToMeasure: ->
|
||||
@screenRowsToMeasure = []
|
||||
@shouldUpdateLinesState = true
|
||||
@shouldUpdateLineNumbersState = true
|
||||
@shouldUpdateDecorations = true
|
||||
|
||||
updateTilesState: ->
|
||||
return unless @startRow? and @endRow? and @lineHeight?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user