mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Floor subpixel aware values when calculating position left
getClientRects() does not return subpixels so subpixels values should be ignored if returned either from scrollView.offset() or scrollLeft().
This commit is contained in:
@@ -1499,7 +1499,7 @@ class Editor extends View
|
||||
range = document.createRange()
|
||||
range.setEnd(textNode, offset)
|
||||
range.collapse()
|
||||
leftPixels = range.getClientRects()[0].left - @scrollView.offset().left + @scrollLeft()
|
||||
leftPixels = range.getClientRects()[0].left - Math.floor(@scrollView.offset().left) + Math.floor(@scrollLeft())
|
||||
range.detach()
|
||||
leftPixels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user