mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Merge pull request #16595 from atom/as-fix-subpixel-aa
Don't break subpixel AA when cursor is at the end of longest line
This commit is contained in:
commit
ef96cc770e
@ -104,7 +104,7 @@ describe('TextEditorComponent', () => {
|
||||
|
||||
{
|
||||
expect(editor.getApproximateLongestScreenRow()).toBe(3)
|
||||
const expectedWidth = Math.round(
|
||||
const expectedWidth = Math.ceil(
|
||||
component.pixelPositionForScreenPosition(Point(3, Infinity)).left +
|
||||
component.getBaseCharacterWidth()
|
||||
)
|
||||
@ -121,7 +121,7 @@ describe('TextEditorComponent', () => {
|
||||
// Capture the width of the lines before requesting the width of
|
||||
// longest line, because making that request forces a DOM update
|
||||
const actualWidth = element.querySelector('.lines').style.width
|
||||
const expectedWidth = Math.round(
|
||||
const expectedWidth = Math.ceil(
|
||||
component.pixelPositionForScreenPosition(Point(6, Infinity)).left +
|
||||
component.getBaseCharacterWidth()
|
||||
)
|
||||
@ -3980,7 +3980,7 @@ describe('TextEditorComponent', () => {
|
||||
// Capture the width of the lines before requesting the width of
|
||||
// longest line, because making that request forces a DOM update
|
||||
const actualWidth = element.querySelector('.lines').style.width
|
||||
const expectedWidth = Math.round(
|
||||
const expectedWidth = Math.ceil(
|
||||
component.pixelPositionForScreenPosition(Point(3, Infinity)).left +
|
||||
component.getBaseCharacterWidth()
|
||||
)
|
||||
|
@ -2694,7 +2694,7 @@ class TextEditorComponent {
|
||||
}
|
||||
|
||||
getContentWidth () {
|
||||
return Math.round(this.getLongestLineWidth() + this.getBaseCharacterWidth())
|
||||
return Math.ceil(this.getLongestLineWidth() + this.getBaseCharacterWidth())
|
||||
}
|
||||
|
||||
getScrollContainerClientWidthInBaseCharacters () {
|
||||
|
Loading…
Reference in New Issue
Block a user