Skip to content

Commit 9944156

Browse files
committed
enclose drawing ion save/restore
1 parent a145836 commit 9944156

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/imagedisplay.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,14 @@ imagedisplay_snapshot(GtkWidget *widget, GtkSnapshot *snapshot)
679679
double pixel_size = 1.0 / gdk_surface_get_scale_factor(surface);
680680
g_object_set(imagedisplay, "pixel-size", pixel_size, NULL);
681681

682-
gtk_snapshot_scale(snapshot, pixel_size, pixel_size);
682+
gtk_snapshot_save(snapshot);
683683

684684
#ifdef HAVE_GTK_SNAPSHOT_SET_SNAP
685685
gtk_snapshot_set_snap(snapshot, GSK_RECT_SNAP_ROUND);
686686
#endif /*HAVE_GTK_SNAPSHOT_SET_SNAP*/
687687

688+
gtk_snapshot_scale(snapshot, pixel_size, pixel_size);
689+
688690
/* Clip to the widget area, or we may paint over the display control
689691
* bar.
690692
*/
@@ -707,10 +709,13 @@ imagedisplay_snapshot(GtkWidget *widget, GtkSnapshot *snapshot)
707709
imagedisplay->y / pixel_size,
708710
&paint, imagedisplay->debug);
709711

712+
// end of clip
713+
gtk_snapshot_pop(snapshot);
714+
715+
gtk_snapshot_restore(snapshot);
716+
710717
// draw any overlays
711718
imagedisplay_overlay_snapshot(imagedisplay, snapshot);
712-
713-
gtk_snapshot_pop(snapshot);
714719
}
715720

716721
static void

0 commit comments

Comments
 (0)