mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
💄
This commit is contained in:
@@ -6,11 +6,10 @@ class Cursor extends Template
|
||||
@pre class: 'cursor', style: 'position: absolute;', => @raw ' '
|
||||
|
||||
viewProperties:
|
||||
setPosition: (@_position) ->
|
||||
setPosition: (@point) ->
|
||||
@updateAbsolutePosition()
|
||||
|
||||
getPosition: ->
|
||||
@_position
|
||||
getPosition: -> @point
|
||||
|
||||
moveUp: ->
|
||||
{ row, col } = @getPosition()
|
||||
@@ -49,6 +48,6 @@ class Cursor extends Template
|
||||
|
||||
|
||||
updateAbsolutePosition: ->
|
||||
position = @parentView.toPixelPosition(@_position)
|
||||
position = @parentView.pixelPositionFromPoint(@point)
|
||||
@css(position)
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class Editor extends Template
|
||||
@lines.append $$.pre(line)
|
||||
@setPosition(row: 0, col: 0)
|
||||
|
||||
toPixelPosition: ({row, col}) ->
|
||||
pixelPositionFromPoint: ({row, col}) ->
|
||||
{ top: row * @lineHeight, left: col * @charWidth }
|
||||
|
||||
calculateDimensions: ->
|
||||
@@ -57,5 +57,5 @@ class Editor extends Template
|
||||
moveDown: -> @cursor.moveDown()
|
||||
moveRight: -> @cursor.moveRight()
|
||||
moveLeft: -> @cursor.moveLeft()
|
||||
setPosition: (position) -> @cursor.setPosition(position)
|
||||
setPosition: (point) -> @cursor.setPosition(point)
|
||||
getPosition: -> @cursor.getPosition()
|
||||
|
||||
Reference in New Issue
Block a user