mirror of
https://github.com/atom/atom.git
synced 2026-02-15 09:05:58 -05:00
Position overlays absolutely
We did so by introducing an `absolute` (optional) parameter in `pixelPositionForScreenPosition`.
This commit is contained in:
@@ -375,7 +375,7 @@ class TextEditorPresenter
|
||||
else
|
||||
screenPosition = decoration.getMarker().getHeadScreenPosition()
|
||||
|
||||
pixelPosition = @pixelPositionForScreenPosition(screenPosition)
|
||||
pixelPosition = @pixelPositionForScreenPosition(screenPosition, true, absolute: true)
|
||||
|
||||
{scrollTop, scrollLeft} = @state.content
|
||||
|
||||
@@ -963,7 +963,7 @@ class TextEditorPresenter
|
||||
hasPixelPositionRequirements: ->
|
||||
@lineHeight? and @baseCharacterWidth?
|
||||
|
||||
pixelPositionForScreenPosition: (screenPosition, clip=true) ->
|
||||
pixelPositionForScreenPosition: (screenPosition, clip=true, {absolute}={}) ->
|
||||
screenPosition = Point.fromObject(screenPosition)
|
||||
screenPosition = @model.clipScreenPosition(screenPosition) if clip
|
||||
|
||||
@@ -993,7 +993,8 @@ class TextEditorPresenter
|
||||
left += characterWidths[char] ? baseCharacterWidth unless char is '\0'
|
||||
column += charLength
|
||||
|
||||
{top: top - @scrollTop, left}
|
||||
top -= @scrollTop unless absolute
|
||||
{top, left}
|
||||
|
||||
hasPixelRectRequirements: ->
|
||||
@hasPixelPositionRequirements() and @scrollWidth?
|
||||
|
||||
Reference in New Issue
Block a user