This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
Char measurement #6083
Closed
Closed
Char measurement #6083
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
63837b3
Wrap every char with a <span>
as-cii 5579d01
Render paired characters as one <span>
as-cii f30b5f9
Calculate pixel position reading DOM
as-cii 64b077d
Generate <span> for spaces as well
as-cii 5e88540
Remove readBeforeUpdateSync as we're not using it now
as-cii 1972f14
Measure chars using DOM ranges
as-cii b0ec19f
Set char widths by row
as-cii 7ef7b6b
Calculate char widths for visible rows only
as-cii f87ad85
Delete any reference to scoped char width
as-cii b219aea
Revert 'Calculate char widths for visible rows'
as-cii 472fb38
Use @newState while iterating over lines
as-cii ab0f239
:racehorse: Fix typo
as-cii 8a2dd82
Merge branch 'master' into as-char-measurement
as-cii 6ccd41e
Use char index instead of buffer column
as-cii cdc82d5
WIP: Experiment with (pre/post) updates
as-cii 79b9389
:art: Split pre/post measure appropriately
as-cii 42d612d
Always calculate decorations
as-cii aa605f0
Update content state in preMeasure
as-cii 09693a0
Avoid reading after updateSync
as-cii 953c5b6
:fire: Remove conditional and use functions
as-cii 8a153f1
Use only batched updateCursorsState
as-cii 0d09282
:racehorse: Measure only when editor is visible and not scrolling
as-cii e213d26
:racehorse: Handle characterWidthsChanged as before
as-cii 8ce3481
:art:
as-cii dad5644
:racehorse: Measure only changed lines
as-cii 6ec4b2f
Invalidate char widths when changing content
as-cii f31237b
:green_heart: Fix TextEditorPresenter specs
as-cii a4188ef
:green_heart: Fix DisplayBuffer specs
as-cii 4996f78
Measure while scrolling
as-cii 4d5fbff
Merge branch 'master' into as-char-measurement
as-cii 69fc7c2
Handle changed lines in TextEditorPresenter
as-cii 9920706
Avoid measuring while scrolling
as-cii df78f68
:white_check_mark: Write specs for char measurement on scrolling
as-cii 73e050c
Move ::getPreMeasureState out in its own describe
as-cii 6ceec8d
:art: Rename to handleCharacterWidthsChanged
as-cii 4c1fb6f
:white_check_mark: Account for larger characters
as-cii 5ad0fb8
Merge branch 'master' into as-char-measurement
as-cii 7bf736d
Dummy canvas
as-cii 843fe02
Store contexts by scopes
as-cii 864f8e0
Clear @contextsByScopeIdentifier
as-cii 9366350
:racehorse: Position <canvas> in iframe
as-cii a8afe4c
Update only needed state in the postMeasure phase
as-cii 6b3926a
:racehorse: Assign IDs to tokens
as-cii cd1a6d1
Store total left
as-cii ae99e02
:fire: Remove leftover specs
as-cii 408af56
Merge branch 'master' into as-char-measurement
as-cii 06a3424
:bug: Avoid measuring only when not scrolling
as-cii 618f8bb
Merge branch 'master' into as-char-measurement
as-cii 7a9410d
:racehorse: Build scopesIdentifier in Token
as-cii a30b95e
Use points instead of plain arrays
as-cii 02d3716
Early return on TextEditorComponent#pollDOM during scrolling
as-cii edd4bf5
:racehorse: Avoid measuring already measured text
as-cii becda2f
Disable subpixel-font-scaling
as-cii 4ee819e
:racehorse: Allow compiler optimizations while iterating hashes
as-cii 463c207
Measure only when lines stay on screen for > 2 frames
as-cii a84dd36
Merge branch 'master' into as-char-measurement
as-cii ec287f6
:green_heart: Fix DisplayBuffer spec failures
as-cii ec6bf36
Remove already measured text optimization
as-cii 535ba2c
:green_heart: Fix TextEditorComponent spec failures
as-cii fa340a3
:green_heart: Fix TextEditorPresenter spec failures
as-cii 65e13d7
:art: Rename to setCharLeftPositionForPoint
as-cii 3aca587
:art: Refactor text measurement
as-cii 3dfc4a9
:art:
as-cii 092c55b
Remove scope nesting
as-cii 5204e1f
Query token inside a specific line
as-cii 54e1228
Fix Token HTML specs
as-cii 5d1009b
Merge branch 'master' into as-char-measurement
as-cii File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not super happy with the name of this method. I couldn't come up with something clever and everything always felt like a mouthful. Any ideas how could we improve it? 💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a slight improvement:
setLeftPixelPositionForPoint
. I think emphasizing pixels is a good idea.