From 63488997eeefd30ddd5a83a1915e5b155b185b2f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 May 2014 12:22:11 -0600 Subject: [PATCH] Give lines and line numbers an opaque background to support sub-pixel AA Since lines and line numbers are now on the GPU, their text won't be properly anti-aliased on low-resolution displays unless their layers have a solid background. --- src/gutter-component.coffee | 2 +- src/lines-component.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gutter-component.coffee b/src/gutter-component.coffee index 2f180badf..04bcfa7d6 100644 --- a/src/gutter-component.coffee +++ b/src/gutter-component.coffee @@ -77,7 +77,7 @@ LineNumberComponent = React.createClass render: -> {index, lineHeight, scrollOffset} = @props div - className: "line-number" + className: "line-number editor-colors" style: {WebkitTransform: "translate3d(0px, #{index * lineHeight + scrollOffset}px, 0px)"} dangerouslySetInnerHTML: {__html: @buildInnerHTML()} diff --git a/src/lines-component.coffee b/src/lines-component.coffee index c51f92bff..b1cd995c2 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -112,7 +112,7 @@ LineComponent = React.createClass left = horizontalScrollOffset style = WebkitTransform: "translate3d(#{left}px, #{top}px, 0px)" - div className: 'line', style: style, 'data-screen-row': screenRow, dangerouslySetInnerHTML: {__html: @buildInnerHTML()} + div className: 'line editor-colors', style: style, 'data-screen-row': screenRow, dangerouslySetInnerHTML: {__html: @buildInnerHTML()} buildInnerHTML: -> if @props.tokenizedLine.text.length is 0