From: Matthias Clasen Date: Tue, 4 Apr 2023 02:19:39 +0000 (-0400) Subject: rendernodepaintable: Preserve aspect ratio in snapshot() X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~4^2~10^2~51 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cad7247f2d68734523a405e2bcb9b8a37368ca4e;p=gtk4.git rendernodepaintable: Preserve aspect ratio in snapshot() This is the better fix. --- diff --git a/gtk/gtkrendernodepaintable.c b/gtk/gtkrendernodepaintable.c index 87bb1ca19a..f7987bdd63 100644 --- 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);