mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
🐛 Use border-box to prevent losing subpixel AA
When highlights are positioned outside the line box, they could get hidden by a subsequent tile (because of its opaque background). As a result, subpixel anti-aliasing gets disabled by Chrome. Using `border-box` as the default `boxSizing` allows highlights to always fit within the line (except if a styling like `margin` is applied).
This commit is contained in:
@@ -76,6 +76,10 @@ class HighlightsComponent
|
||||
unless oldHighlightState.regions[i]?
|
||||
oldHighlightState.regions[i] = {}
|
||||
regionNode = document.createElement('div')
|
||||
# This prevents highlights at the tiles boundaries to be hidden by the
|
||||
# subsequent tile. When this happens, subpixel anti-aliasing gets
|
||||
# disabled.
|
||||
regionNode.style.boxSizing = "border-box"
|
||||
regionNode.classList.add('region')
|
||||
regionNode.classList.add(newHighlightState.deprecatedRegionClass) if newHighlightState.deprecatedRegionClass?
|
||||
@regionNodesByHighlightId[id][i] = regionNode
|
||||
|
||||
Reference in New Issue
Block a user