-
Notifications
You must be signed in to change notification settings - Fork 780
femtovg/skia: Fix rendering of children outside a layer's intrinsic bounding rect #10109
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
base: master
Are you sure you want to change the base?
Conversation
…ng rect The layer clips (by being a texture), so we must make sure to size it beyond its intrinsic size and include the bounding rect of the children, in size **and** position. cc #9808
ogoffart
left a comment
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.
My commit called
Femtovg: Align the layer on the pixel grid
Doesn't work as expected. Because rounded position are not aligned on the pixel grid because there could be a non-integer translation, and as a result, adding an opactiy makes the text blury.
| if let Some((layer_offset, layer_image)) = self.render_layer(item_rc, &|| { | ||
| // We don't need to include the size of the "layer" item itself, since it has no content. | ||
| let children_rect = i_slint_core::properties::evaluate_no_tracking(|| { | ||
| item_rc.geometry().union( |
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.
As the comment two line earlier say, you don't need this union (and i've removed it for femtovg in one of my commits)
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.
Done :)
The layer_origin should normally always be 0,0 for the Clip element since the Clip element always cover its parent. But the correct thing to do is anyway to translate by the origin.
…rect The layer clips (by being a texture), so we must make sure to size it beyond its intrinsic size and include the bounding rect of the children, in size **and** position. cc #9808
(as advised by Olivier and also done in femtovg)
4e03326 to
0cd1112
Compare
ACK, I've removed the commit. |
expenses
left a comment
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.
Looks good
|
|
||
| pub enum ItemGraphicsCacheEntry<R: femtovg::Renderer + TextureImporter> { | ||
| Texture(Rc<Texture<R>>), | ||
| TextureWithOrigin { |
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.
Could do with a line of documentation here
| cached_image | ||
| }); | ||
| let image_id = match cache_entry { | ||
| Some(ItemGraphicsCacheEntry::Texture(image)) => image.id, |
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.
this should probably be texture.id as well.
59285c1 to
5ff952c
Compare
The layer clips (by being a texture), so we must make sure to size it
beyond its intrinsic size and include the bounding rect of the children,
in size and position.
Fixes #9808