[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text snaps to pixel grid, images don't #2093

Merged
merged 1 commit into from
Nov 20, 2015
Merged

Conversation

abarth
Copy link
Contributor
@abarth abarth commented Nov 20, 2015

Previously, we tried to use the render tree's paint offset to move the text to
the proper position, but that appears to snap to integer logical pixels,
introducing jitter. Now we use the SkCanvas's matrix to position the text,
removing the jitter.

Fixes flutter/flutter#234

@krisgiesing
Copy link
Contributor

LGTM

@@ -52,7 +52,7 @@ double Paragraph::ideographicBaseline()

void Paragraph::layout()
{
FontCachePurgePreventer fontCachePurgePreventer;
FontCachePurgePreventer fontCachePurgePreventer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not that i care, but fyi there's a new trailing space here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHUT DOWN EVERYTHING

@eseidelGoogle
Copy link
Contributor

I would think the text renderer might want to know the sub-pixel positioning itself. But this will probably work for now.

Previously, we tried to use the render tree's paint offset to move the text to
the proper position, but that appears to snap to integer logical pixels,
introducing jitter. Now we use the SkCanvas's matrix to position the text,
removing the jitter.

Fixes flutter/flutter#234
@abarth
Copy link
Contributor Author
abarth commented Nov 20, 2015

I would think the text renderer might want to know the sub-pixel positioning itself. But this will probably work for now.

Yeah, unfortunately there's no way for it to know (on the web too) because you might have a transform higher in the tree that's changed your coordinate system.

abarth added a commit that referenced this pull request Nov 20, 2015
Text snaps to pixel grid, images don't
@abarth abarth merged commit 1c7a36c into flutter:master Nov 20, 2015
@abarth abarth deleted the jittery_text branch November 20, 2015 20:50
rhencke pushed a commit to rhencke/engine that referenced this pull request Dec 20, 2020
rhencke pushed a commit to rhencke/engine that referenced this pull request Dec 20, 2020
rhencke pushed a commit to rhencke/engine that referenced this pull request Dec 20, 2020
* 0.1.116

* typo

* typo

* marked no_default_cases as experimental
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants