🎨 tileId -> tileRow

This commit is contained in:
Antonio Scandurra
2015-05-13 12:44:06 +02:00
parent 467f4a30d7
commit 25acaf26c1
3 changed files with 16 additions and 16 deletions

View File

@@ -354,7 +354,7 @@ class TextEditorComponent
event.preventDefault() unless previousScrollLeft is @presenter.getScrollLeft()
else
# Scrolling vertically
@presenter.setScrollingTileId(@tileIdForNode(event.target))
@presenter.setScrollingTileRow(@tileRowForNode(event.target))
previousScrollTop = @presenter.getScrollTop()
@presenter.setScrollTop(previousScrollTop - Math.round(wheelDeltaY * @scrollSensitivity))
event.preventDefault() unless previousScrollTop is @presenter.getScrollTop()
@@ -729,7 +729,7 @@ class TextEditorComponent
lineNumberNodeForScreenRow: (screenRow) -> @gutterContainerComponent.getLineNumberGutterComponent().lineNumberNodeForScreenRow(screenRow)
tileIdForNode: (node) ->
tileRowForNode: (node) ->
while node?
if tileId = node.dataset.tileId
return tileId

View File

@@ -304,10 +304,10 @@ class TextEditorPresenter
tileForRow: (row) ->
row - (row % @tileSize)
isValidTile: (tileId) ->
return false unless tileId?
isValidTile: (tileRow) ->
return false unless tileRow?
tileId <= @tileForRow(@model.getLastScreenRow())
tileRow <= @tileForRow(@model.getLastScreenRow())
getVisibleTilesRange: ->
startTileRow = Math.max(0, @tileForRow(@startRow))
@@ -335,9 +335,9 @@ class TextEditorPresenter
visibleTiles[startRow] = true
if @isValidTile(@scrollingTileId) and not visibleTiles[@scrollingTileId]?
@state.content.tiles[@scrollingTileId].display = "none"
visibleTiles[@scrollingTileId] = true
if @isValidTile(@scrollingTileRow) and not visibleTiles[@scrollingTileRow]?
@state.content.tiles[@scrollingTileRow].display = "none"
visibleTiles[@scrollingTileRow] = true
for id, tile of @state.content.tiles
continue if visibleTiles.hasOwnProperty(id)
@@ -779,8 +779,8 @@ class TextEditorPresenter
didStopScrolling: ->
@state.content.scrollingVertically = false
if @scrollingTileId?
@scrollingTileId = null
if @scrollingTileRow?
@scrollingTileRow = null
@shouldUpdateTilesState = true
@shouldUpdateLineNumbersState = true
@shouldUpdateCustomGutterDecorationState = true
@@ -946,9 +946,9 @@ class TextEditorPresenter
@emitDidUpdateState()
setScrollingTileId: (tileId) ->
if @scrollingTileId isnt tileId
@scrollingTileId = tileId
setScrollingTileRow: (tileRow) ->
if @scrollingTileRow isnt tileRow
@scrollingTileRow = tileRow
@didStartScrolling()
setBaseCharacterWidth: (baseCharacterWidth) ->