Fix error in highlight region width calculation

This commit is contained in:
Max Brunsfeld
2016-11-28 12:26:48 -08:00
parent f198a0fd71
commit 0352820d8c

View File

@@ -1001,8 +1001,7 @@ class TextEditorPresenter
@lineHeight? and @baseCharacterWidth?
pixelPositionForScreenPosition: (screenPosition) ->
position =
@linesYardstick.pixelPositionForScreenPosition(screenPosition)
position = @linesYardstick.pixelPositionForScreenPosition(screenPosition)
position.top -= @getScrollTop()
position.left -= @getScrollLeft()
@@ -1225,13 +1224,14 @@ class TextEditorPresenter
screenRange.end.column = 0
repositionRegionWithinTile: (region, tileStartRow) ->
region.top += @scrollTop - @lineTopIndex.pixelPositionBeforeBlocksForRow(tileStartRow)
region.left += @scrollLeft
region.top += @scrollTop - @lineTopIndex.pixelPositionBeforeBlocksForRow(tileStartRow)
buildHighlightRegions: (screenRange) ->
lineHeightInPixels = @lineHeight
startPixelPosition = @pixelPositionForScreenPosition(screenRange.start)
endPixelPosition = @pixelPositionForScreenPosition(screenRange.end)
startPixelPosition.left += @scrollLeft
endPixelPosition.left += @scrollLeft
spannedRows = screenRange.end.row - screenRange.start.row + 1
regions = []