picture: Keep paintable size integral

Without this, offloading is very hit-and-miss, since you need
to hit the few size combinations where you get an exact integral
size when preserving the aspect ratio.
This commit is contained in:
Matthias Clasen 2023-11-21 11:11:38 -05:00
parent 463b6dd1fd
commit 8691d471d0

View File

@ -173,8 +173,11 @@ gtk_picture_snapshot (GtkWidget *widget,
}
}
x = (width - ceil (w)) / 2;
y = floor(height - ceil (h)) / 2;
w = ceil (w);
h = ceil (h);
x = (width - w) / 2;
y = floor(height - h) / 2;
gtk_snapshot_save (snapshot);
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));