25 Commits

Author SHA1 Message Date
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
Antonio Scandurra
e843c2f058 🐎 Fetch scopes only if required 2015-10-16 11:03:15 +02: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
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
b6a0db916f 🐛 Fix wrong pixel to screen position conversion 2015-10-01 13:05:50 +02:00
Antonio Scandurra
243dea1a1c 🎨 Move pixel-related code to LinesYardstick
* 🔥 Remove useless 'scoped char width' methods
2015-10-01 11:03:25 +02:00
Antonio Scandurra
58219a243e Slightly more precise conversion to screen positions 2015-09-30 18:20:48 +02:00
Antonio Scandurra
bca3be32e6 Avoid to call ::prepareScreenRows explicitly 2015-09-30 16:23:49 +02:00
Antonio Scandurra
bb709f58d9 🐎 Cache pixel positions 2015-09-30 16:15:49 +02:00
Antonio Scandurra
59d6974f89 🐎 Remove AcceptFilter
...so that Chrome doesn't need to switch to user space when iterating over line
nodes.
2015-09-30 16:03:36 +02:00
Antonio Scandurra
123594dbbf Implement ::screenPositionForPixelPosition in LinesYardstick 2015-09-29 17:13:49 +02:00
Antonio Scandurra
e6a72b794c Temporarily disable caching from yardstick
This will enable us to avoid worrying about cache invalidation while integrating
`LinesYardstick` into `TextEditorPresenter`.
2015-09-29 15:16:51 +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
be843cc4df 🐎 Cache positions 2015-09-17 14:22:27 +02:00
Antonio Scandurra
80d872c4ac Avoid calling getBoundingClientRect twice for each line 2015-09-17 11:51:03 +02:00
Antonio Scandurra
d78c166d6b Merge branch 'master' into as-double-reflow-measurements 2015-09-17 11:32:26 +02:00
Antonio Scandurra
42e58f1dd3 💚 Use tokenizedLine.id to refer to lines 2015-09-17 11:10:32 +02:00
Antonio Scandurra
2542a8d603 Integrate LinesYardstick with TextEditorComponent 2015-09-16 12:32:26 +02:00
Antonio Scandurra
29846d0a51 Add LinesYardstick
...and create a MockLineNodesProvider for testing purposes
2015-09-15 18:41:41 +02:00