Commit Graph

16 Commits

Author SHA1 Message Date
Nathan Sobo
9f6fbacddd Don’t clip screen positions in yardstick
By clipping positions only in the TextEditorComponent, we can ensure
that we check for the presence of a rendered line for the clipped row
value.
2016-01-04 16:32:38 -07:00
Nathan Sobo
85c6139579 Don’t force DOM updates in LinesYardstick
Instead, determine the need for a DOM update in the component before
measuring with the lines yardstick, and break `updateSync` into two
explicit pre- and post-measurement phases.
2015-12-10 14:47:05 -07:00
Antonio Scandurra
6decf222a3 🐛 Fix incorrectly reported width when measuring lines
This commit fixes what seems to be a bug in Chromium.

When measuring lines (and with a special character sequence), it could happen
that Range(0, 0). getBoundingClientRect().width reports a number greater than 0.
This seems to happen when the font size is smaller than 12px and it's probably
due to subpixel font scaling. To solve it we've explicitly included a guard
clause that prevents this problem to happen.
2015-11-01 19:23:09 +01:00
Nathan Sobo
661607857f Fix spec failures due to slight changes in DOM positioning 2015-10-16 11:08:52 -06:00
Nathan Sobo
4c51d29868 Merge remote-tracking branch 'origin/master' into ns-alternative-test-env 2015-10-07 16:10:29 -05:00
Antonio Scandurra
61892f932b Use cached text nodes instead of NodeIterator 2015-10-06 10:43:32 +02:00
Antonio Scandurra
1c56c3f951 🎨 2015-10-05 16:32:51 +02:00
Antonio Scandurra
581ffb1360 🐎 Avoid to measure invisible lines when dragging 2015-10-05 16:05:17 +02:00
Antonio Scandurra
beb7896234 Enable subpixel font scaling
For certain font sizes, enabling `textRendering: optimizeLegibility` caused a
bunch of measurement-related issues. You can reproduce it by setting the following in your stylesheet:

```
atom-text-editor {
  font-size: 14px;
  text-rendering: optimizeLegibility;
}
```

Although I wanted to defer subpixel font scaling to a later moment, it seems
like Chrome needs to have it enabled in order to properly support the
"legibility" path for text rendering. (I guess this is part of the reason why
the Chromium team enabled it by default at some point in the past.)
2015-10-02 18:14:09 +02:00
Antonio Scandurra
b7e373fdca 🐛 Correctly measure RTL characters
This will fix also the "hidden cursor" issue we were experiencing.

/cc: @izuzak
2015-10-02 12:51:10 +02:00
Antonio Scandurra
2ffa7da59e 🐎 Remove rows to measure in the next frame 2015-10-02 12:38:19 +02:00
Antonio Scandurra
33523751ea Thoroughly test LinesYardstick interactions 2015-10-01 18:34:41 +02:00
Antonio Scandurra
af41b71cd8 Redesign LinesYardstick 2015-09-20 12:10:09 +02:00
Antonio Scandurra
bf7d7e0d2a Improve LinesYardstick design
We have shifted the responsibility of orchestrating state updates and
measurements to the yardstick. The presenter still needs to be updated to make
use of these new capabilities.
2015-09-18 10:17:55 +02:00
Antonio Scandurra
2ad336c649 💚 2015-09-17 16:26:55 +02:00
Antonio Scandurra
29846d0a51 Add LinesYardstick
...and create a MockLineNodesProvider for testing purposes
2015-09-15 18:41:41 +02:00