mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Round column measurements to nearest whole pixel
This preserves the expected behavior for positioning overlays, etc so that package tests keep passing.
This commit is contained in:
committed by
Antonio Scandurra
parent
84c20d95d4
commit
c76fc5af2d
@@ -1945,7 +1945,7 @@ class TextEditorComponent {
|
||||
clientPixelPosition = clientRectForRange(textNode, 0, nextColumnToMeasure - textNodeStartColumn).right
|
||||
}
|
||||
if (lineNodeClientLeft === -1) lineNodeClientLeft = lineNode.getBoundingClientRect().left
|
||||
positions.set(nextColumnToMeasure, clientPixelPosition - lineNodeClientLeft)
|
||||
positions.set(nextColumnToMeasure, Math.round(clientPixelPosition - lineNodeClientLeft))
|
||||
continue columnLoop // eslint-disable-line no-labels
|
||||
} else {
|
||||
textNodesIndex++
|
||||
|
||||
Reference in New Issue
Block a user