mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Add a check for negative bounds when translating the overlay
This commit is contained in:
@@ -36,10 +36,12 @@ class OverlayManager
|
||||
itemHeight = item.offsetHeight
|
||||
|
||||
left = pixelPosition.left
|
||||
left -= itemWidth if left + itemWidth - editor.getScrollLeft() > editor.getWidth()
|
||||
if left + itemWidth - editor.getScrollLeft() > editor.getWidth() and left - itemWidth >= editor.getScrollLeft()
|
||||
left -= itemWidth
|
||||
|
||||
top = pixelPosition.top + lineHeightInPixels
|
||||
top -= itemHeight + lineHeightInPixels if top + itemHeight - editor.getScrollTop() > editor.getHeight()
|
||||
if top + itemHeight - editor.getScrollTop() > editor.getHeight() and top - itemHeight - lineHeightInPixels >= editor.getScrollTop()
|
||||
top -= itemHeight + lineHeightInPixels
|
||||
|
||||
overlay.style.top = top + 'px'
|
||||
overlay.style.left = left + 'px'
|
||||
|
||||
Reference in New Issue
Block a user