[gtk/wip/baedert/for-master: 179/180] dnd demo: Make the transform code a bit more idiomatic
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 179/180] dnd demo: Make the transform code a bit more idiomatic
- Date: Fri, 16 Oct 2020 19:58:53 +0000 (UTC)
commit 09a051c6b63e43be99ddbe033446fcea9e1a2b3f
Author: Timm Bäder <mail baedert org>
Date: Fri Oct 16 17:06:00 2020 +0200
dnd demo: Make the transform code a bit more idiomatic
demos/gtk-demo/dnd.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/dnd.c b/demos/gtk-demo/dnd.c
index 2cdca577d9..84c0a2d3be 100644
--- a/demos/gtk-demo/dnd.c
+++ b/demos/gtk-demo/dnd.c
@@ -113,12 +113,9 @@ apply_transform (CanvasItem *item)
y = gtk_widget_get_allocated_height (item->label) / 2.0;
item->r = sqrt (x*x + y*y);
- transform = gsk_transform_translate (
- gsk_transform_rotate (
- gsk_transform_translate (NULL,
- &(graphene_point_t) { item->r, item->r }),
- item->angle + item->delta),
- &(graphene_point_t) { - x, - y });
+ transform = gsk_transform_translate (NULL, &(graphene_point_t) { item->r, item->r });
+ transform = gsk_transform_rotate (transform, item->angle + item->delta);
+ transform = gsk_transform_translate (transform, &(graphene_point_t) { -x, -y });
gtk_fixed_set_child_transform (GTK_FIXED (item->fixed), item->label, transform);
gsk_transform_unref (transform);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]