mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
swrenderer: fix image drawing when the image is not stretched to the geometry
This would cause some of the image to be drawn outside of the clip region, which may even lead to panics (Fix changing pages in the energy-monitor demo)
This commit is contained in:
parent
04eacbb526
commit
5a54fcfeb1
1 changed files with 1 additions and 0 deletions
|
|
@ -1013,6 +1013,7 @@ impl<'a, T: ProcessScene> SceneBuilder<'a, T> {
|
|||
|
||||
let renderer_clip_in_source_rect_space = (self.current_state.clip.cast()
|
||||
* self.scale_factor)
|
||||
.translate(-image_fit_offset)
|
||||
.scale(1. / source_to_target_x, 1. / source_to_target_y);
|
||||
match image_inner {
|
||||
ImageInner::None => (),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue