mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
add stable
option
This commit is contained in:
parent
c673362676
commit
e5ab835357
@ -451,7 +451,7 @@ class TextEditorPresenter
|
||||
for decoration in @model.getOverlayDecorations()
|
||||
continue unless decoration.getMarker().isValid()
|
||||
|
||||
{item, position, class: klass} = decoration.getProperties()
|
||||
{item, position, class: klass, stable} = decoration.getProperties()
|
||||
if position is 'tail'
|
||||
screenPosition = decoration.getMarker().getTailScreenPosition()
|
||||
else
|
||||
@ -466,15 +466,17 @@ class TextEditorPresenter
|
||||
if overlayDimensions = @overlayDimensions[decoration.id]
|
||||
{itemWidth, itemHeight, contentMargin} = overlayDimensions
|
||||
|
||||
rightDiff = left + itemWidth + contentMargin - @windowWidth
|
||||
left -= rightDiff if rightDiff > 0
|
||||
if !stable
|
||||
|
||||
leftDiff = left + contentMargin
|
||||
left -= leftDiff if leftDiff < 0
|
||||
rightDiff = left + itemWidth + contentMargin - @windowWidth
|
||||
left -= rightDiff if rightDiff > 0
|
||||
|
||||
if top + itemHeight > @windowHeight and
|
||||
top - (itemHeight + @lineHeight) >= 0
|
||||
top -= itemHeight + @lineHeight
|
||||
leftDiff = left + contentMargin
|
||||
left -= leftDiff if leftDiff < 0
|
||||
|
||||
if top + itemHeight > @windowHeight and
|
||||
top - (itemHeight + @lineHeight) >= 0
|
||||
top -= itemHeight + @lineHeight
|
||||
|
||||
pixelPosition.top = top
|
||||
pixelPosition.left = left
|
||||
|
Loading…
Reference in New Issue
Block a user