From 701203c0aacc84cc3ee18557f60a1ca1fb2730f1 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Wed, 23 Jul 2025 19:49:55 +0200 Subject: [PATCH] Meson: fix feature detect for `gtk_snapshot_set_snap()` --- meson.build | 2 +- src/tilecache.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ccf7baf..b760991 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,7 @@ add_project_arguments('-I.', language: 'c') gtk_dep = dependency('gtk4', version: '>=4.14') # use this to fix tile alignment, not yet merged -config_h.set('HAVE_GTK_SNAPSHOT_SET_SNAP', cc.has_header_symbol('gtk.h', 'gtk_snapshot_set_snap', dependencies: gtk_dep)) +config_h.set('HAVE_GTK_SNAPSHOT_SET_SNAP', cc.has_function('gtk_snapshot_set_snap', prefix: '#include ', dependencies: gtk_dep)) configure_file( output: 'config.h', diff --git a/src/tilecache.c b/src/tilecache.c index 841222e..23b3111 100644 --- a/src/tilecache.c +++ b/src/tilecache.c @@ -941,7 +941,6 @@ tilecache_snapshot(Tilecache *tilecache, GtkSnapshot *snapshot, graphene_rect_t bounds; - // +1 to hide tile boundaries bounds.origin.x = tile->bounds0.left * scale - x + paint->origin.x; bounds.origin.y = tile->bounds0.top * scale - y + paint->origin.y; bounds.size.width = tile->bounds0.width * scale; @@ -953,7 +952,7 @@ tilecache_snapshot(Tilecache *tilecache, GtkSnapshot *snapshot, */ bounds.size.width += 1; bounds.size.height += 1; -#endif /*HAVE_GTK_SNAPSHOT_SET_SNAP*/ +#endif /*!HAVE_GTK_SNAPSHOT_SET_SNAP*/ gtk_snapshot_append_scaled_texture(snapshot, tile_get_texture(tile), filter, &bounds);