mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
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:
parent
463b6dd1fd
commit
8691d471d0
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user