summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-02-21 05:34:12 +0100
committerBenjamin Otte <otte@redhat.com>2019-02-21 19:47:28 +0100
commit751ef5b5b9377b5e8cb3947cb533a366d664aff4 (patch)
treeb832b2b7fdb0373d40fb5462e78c376c6103fada
parent5965ead5a70aa15ae27819c3e6756d2c10f7d35d (diff)
downloadgtk+-751ef5b5b9377b5e8cb3947cb533a366d664aff4.tar.gz
widgetpaintable: Use new snapshot transforms
-rw-r--r--gtk/gtkwidgetpaintable.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gtk/gtkwidgetpaintable.c b/gtk/gtkwidgetpaintable.c
index 23a359d204..f1da13fed2 100644
--- a/gtk/gtkwidgetpaintable.c
+++ b/gtk/gtkwidgetpaintable.c
@@ -91,28 +91,20 @@ gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
return;
else if (self->snapshot_count > 0)
{
- graphene_matrix_t transform;
graphene_rect_t bounds;
gtk_snapshot_push_clip (snapshot,
&GRAPHENE_RECT_INIT(0, 0, width, height));
+
if (gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
{
- graphene_matrix_init_from_2d (&transform,
- width / bounds.size.width, 0.0,
- 0.0, height / bounds.size.height,
- bounds.origin.x, bounds.origin.y);
- }
- else
- {
- graphene_matrix_init_identity (&transform);
+ gtk_snapshot_scale (snapshot, width / bounds.size.width, height / bounds.size.height);
+ gtk_snapshot_translate (snapshot, &bounds.origin);
}
- gtk_snapshot_push_transform (snapshot, &transform);
gtk_widget_snapshot (self->widget, snapshot);
gtk_snapshot_pop (snapshot);
- gtk_snapshot_pop (snapshot);
}
else
{