mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
label: Don't leak clip regions
This was introduced in the conversion to gsk.
This commit is contained in:
parent
e6bbc10bd5
commit
6bdebd1570
@ -3948,11 +3948,14 @@ gtk_label_snapshot (GtkWidget *widget,
|
||||
|
||||
range_clip = gdk_pango_layout_get_clip_region (priv->layout, lx, ly, range, 1);
|
||||
cairo_region_get_extents (range_clip, &clip_extents);
|
||||
|
||||
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_extents), "Selected Text");
|
||||
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
|
||||
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
cairo_region_destroy (range_clip);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
else if (info)
|
||||
@ -3995,6 +3998,8 @@ gtk_label_snapshot (GtkWidget *widget,
|
||||
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
||||
gtk_snapshot_pop (snapshot);
|
||||
|
||||
cairo_region_destroy (range_clip);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user