projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70e56f0
)
rendernodepaintable: Preserve aspect ratio in snapshot()
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 4 Apr 2023 02:19:39 +0000
(22:19 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 4 Apr 2023 02:33:34 +0000
(22:33 -0400)
This is the better fix.
gtk/gtkrendernodepaintable.c
patch
|
blob
|
history
diff --git
a/gtk/gtkrendernodepaintable.c
b/gtk/gtkrendernodepaintable.c
index 1379ba34049381301029d89359ecf992bd71a040..3e994ad8e99b368577c9759477c31aa7a96e3370 100644
(file)
--- a/
gtk/gtkrendernodepaintable.c
+++ b/
gtk/gtkrendernodepaintable.c
@@
-52,8
+52,8
@@
gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable,
gtk_snapshot_save (snapshot);
gtk_snapshot_scale (snapshot,
- width / (self->bounds.size.width),
- height / (self->bounds.size.height));
+ width /
ceilf
(self->bounds.size.width),
+ height /
ceilf
(self->bounds.size.height));
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (-self->bounds.origin.x, -self->bounds.origin.y));
gtk_snapshot_push_clip (snapshot, &self->bounds);