ui/gtk/image.c

branch
newapi
changeset 381
b47bda6666ce
parent 340
2dd42bd4fe5d
--- a/ui/gtk/image.c	Wed Nov 13 21:30:18 2024 +0100
+++ b/ui/gtk/image.c	Wed Nov 13 22:02:50 2024 +0100
@@ -93,12 +93,12 @@
     GdkPixbuf *pixbuf = value;
     
     if(pixbuf) {
-        int width, height;
-#if GTK_CHECK_VERSION(4, 12, 0)
+        int width = gdk_pixbuf_get_width(pixbuf);
+        int height = gdk_pixbuf_get_height(pixbuf);
+        
+#if GTK_CHECK_VERSION(4, 0, 0)
         GdkTexture *texture = gdk_texture_new_for_pixbuf(pixbuf);
         gtk_picture_set_paintable(GTK_PICTURE(g->obj), GDK_PAINTABLE(texture));
-        width = gdk_texture_get_width(texture);
-        height = gdk_texture_get_height(texture);
 #else
         gtk_image_set_from_pixbuf(GTK_IMAGE(g->obj), pixbuf);
 #endif

mercurial