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

fix scale, rename transform to translate #590

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

jrmoulton
Copy link
Collaborator

@jrmoulton
Copy link
Collaborator Author

This doesn't claim to implement rotation. rotation would have to be even more special handling in the renderer

@jrmoulton
Copy link
Collaborator Author

This also doesn't fix event handling. I'll do that in another PR

src/style.rs Outdated
@@ -1646,8 +1647,10 @@ prop_extractor! {
pub scale_x: ScaleX,
pub scale_y: ScaleY,

pub transform_x: TransformX,
pub transform_y: TransformY,
pub transform_x: TranslateX,
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably forgot the prop name here

@timsueberkrueb
Copy link
Contributor

This is great, thank you @jrmoulton! It fixes font rendering when scaling.

This doesn't claim to implement rotation. rotation would have to be even more special handling in the renderer

Maybe this gets easier if all transformations are consistently handled as a single affine transformation matrix (which is already partially the case). At the moment, with the vger renderer, we extract the individual properties (like translation and scale) from the transformation matrix instead of applying it directly. Maybe it makes sense to change this when we switch to Vello? I've seen that its API has first-class support for passing transformation matrices.

Anyways, I don't need rotation for my use case right now, but I think it would be nice to have eventually (for animations, spinners, etc).

@jrmoulton
Copy link
Collaborator Author

jrmoulton commented Sep 27, 2024

This can sometimes trigger some strange effects when animating scale.

It doesn't happen consistently.

I've watched all of the scale values that affect the different properties while animating and they look correct. I now believe this is some bug in vger and not in these changes

output2.mp4

@jrmoulton
Copy link
Collaborator Author

. Maybe it makes sense to change this when we switch to Vello? I've seen that its API has first-class support for passing transformation matrices.

yeah in my branch for vello this should already be handled.

@jrmoulton
Copy link
Collaborator Author

output3.mp4

@dzhou121 dzhou121 merged commit cdd2326 into lapce:main Sep 30, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants