mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 23:24:16 +00:00
widgetpaintable: Use new snapshot transforms
This commit is contained in:
parent
5965ead5a7
commit
751ef5b5b9
@ -91,28 +91,20 @@ gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
return;
|
return;
|
||||||
else if (self->snapshot_count > 0)
|
else if (self->snapshot_count > 0)
|
||||||
{
|
{
|
||||||
graphene_matrix_t transform;
|
|
||||||
graphene_rect_t bounds;
|
graphene_rect_t bounds;
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot,
|
||||||
&GRAPHENE_RECT_INIT(0, 0, width, height));
|
&GRAPHENE_RECT_INIT(0, 0, width, height));
|
||||||
|
|
||||||
if (gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
|
if (gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
|
||||||
{
|
{
|
||||||
graphene_matrix_init_from_2d (&transform,
|
gtk_snapshot_scale (snapshot, width / bounds.size.width, height / bounds.size.height);
|
||||||
width / bounds.size.width, 0.0,
|
gtk_snapshot_translate (snapshot, &bounds.origin);
|
||||||
0.0, height / bounds.size.height,
|
|
||||||
bounds.origin.x, bounds.origin.y);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
graphene_matrix_init_identity (&transform);
|
|
||||||
}
|
|
||||||
gtk_snapshot_push_transform (snapshot, &transform);
|
|
||||||
|
|
||||||
gtk_widget_snapshot (self->widget, snapshot);
|
gtk_widget_snapshot (self->widget, snapshot);
|
||||||
|
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
gtk_snapshot_pop (snapshot);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user