mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Ensure underlayer and overlayer are always the same width as lines
Also… simplify CSS rules for lines element. No display table or padding, instead we just set the min width when typing.
This commit is contained in:
@@ -819,8 +819,8 @@ fdescribe "Editor", ->
|
||||
expect(region1.position().top).toBeCloseTo(2 * lineHeight)
|
||||
expect(region1.position().left).toBeCloseTo(7 * charWidth)
|
||||
expect(region1.height()).toBeCloseTo lineHeight
|
||||
expect(region1.width()).toBeCloseTo(editor.renderedLines.outerWidth() - region1.position().left)
|
||||
|
||||
expect(region1.width()).toBeCloseTo(editor.renderedLines.outerWidth() - region1.position().left)
|
||||
region2 = selectionView.regions[1]
|
||||
expect(region2.position().top).toBeCloseTo(3 * lineHeight)
|
||||
expect(region2.position().left).toBeCloseTo(0)
|
||||
@@ -837,8 +837,8 @@ fdescribe "Editor", ->
|
||||
expect(region1.position().top).toBeCloseTo(2 * lineHeight)
|
||||
expect(region1.position().left).toBeCloseTo(7 * charWidth)
|
||||
expect(region1.height()).toBeCloseTo lineHeight
|
||||
expect(region1.width()).toBeCloseTo(editor.renderedLines.outerWidth() - region1.position().left)
|
||||
|
||||
expect(region1.width()).toBeCloseTo(editor.renderedLines.outerWidth() - region1.position().left)
|
||||
region2 = selectionView.regions[1]
|
||||
expect(region2.position().top).toBeCloseTo(3 * lineHeight)
|
||||
expect(region2.position().left).toBeCloseTo(0)
|
||||
|
||||
@@ -730,7 +730,7 @@ class Editor extends View
|
||||
@renderedLines.css('padding-bottom', heightOfRenderedLines)
|
||||
|
||||
adjustMinWidthOfRenderedLines: ->
|
||||
minWidth = @charWidth * @maxScreenLineLength()
|
||||
minWidth = @charWidth * @maxScreenLineLength() + 20
|
||||
unless @renderedLines.cachedMinWidth == minWidth
|
||||
@renderedLines.css('min-width', minWidth)
|
||||
@underlayer.css('min-width', minWidth)
|
||||
|
||||
@@ -73,32 +73,28 @@
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.editor .underlayer, .editor .overlayer {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
|
||||
.editor .underlayer, .editor .lines, .editor .overlayer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.editor .underlayer {
|
||||
z-index: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.editor .lines {
|
||||
position: relative;
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
/*overflow: hidden; i'm worried this is causing rendering problems */
|
||||
padding-right: 2em;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.editor .overlayer {
|
||||
z-index: 2;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
.editor .line span {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user