summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-02-19 08:11:42 +0100
committerBenjamin Otte <otte@redhat.com>2019-02-21 19:47:27 +0100
commitc24f32619f4ccdd299eec7c0768be9e7adf7edd4 (patch)
tree8db9fa6fa7e1772fc4b937c2bd1a4f2425822b94 /tests
parent49d83820a2cfdc547abd4d1f344fa6eea86178ac (diff)
downloadgtk+-c24f32619f4ccdd299eec7c0768be9e7adf7edd4.tar.gz
widget: Make gtk_widget_allocate() take a GtkTransform
We can reason about GtkTransform way better - and determine its category or do equality checks.
Diffstat (limited to 'tests')
-rw-r--r--tests/testwidgettransforms.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/testwidgettransforms.c b/tests/testwidgettransforms.c
index 9200335cdb..1c3048d886 100644
--- a/tests/testwidgettransforms.c
+++ b/tests/testwidgettransforms.c
@@ -104,7 +104,7 @@ gtk_transform_tester_size_allocate (GtkWidget *widget,
int baseline)
{
GtkTransformTester *self = (GtkTransformTester *)widget;
- graphene_matrix_t global_transform;
+ GtkTransform *global_transform;
int w, h;
if (!self->test_widget)
@@ -119,24 +119,18 @@ gtk_transform_tester_size_allocate (GtkWidget *widget,
g_message ("%s: %d, %d", __FUNCTION__, w, h);
- graphene_matrix_init_identity (&global_transform);
+ global_transform = NULL;
- graphene_matrix_translate (&global_transform, &(graphene_point3d_t){ -w/2.0f, -h/2.0f, 0});
- graphene_matrix_rotate (&global_transform, scale,
- graphene_vec3_z_axis ());
+ global_transform = gtk_transform_translate (global_transform, &GRAPHENE_POINT_INIT (width / 2.0f, height / 2.0f));
+ global_transform = gtk_transform_rotate (global_transform, scale);
+ global_transform = gtk_transform_translate (global_transform, &GRAPHENE_POINT_INIT (-w / 2.0f, -h / 2.0f));
- graphene_matrix_translate (&global_transform, &(graphene_point3d_t){ width / 2.0f, height / 2.0f, 0});
-
-
-#if 0
- gtk_widget_size_allocate (self->test_widget,
- &(GtkAllocation){ (width- w) / 2, (height - h) / 2, w,h }, -1);
-#else
gtk_widget_allocate (self->test_widget,
w, h,
-1,
- &global_transform);
-#endif
+ global_transform);
+
+ gtk_transform_unref (global_transform);
}
static void