[gtk] roundedrect: Add gsk_rounded_rect_to_string
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] roundedrect: Add gsk_rounded_rect_to_string
- Date: Thu, 28 Feb 2019 09:42:08 +0000 (UTC)
commit dc282991c6611a77f0f1049750c3fd7b6d085bb3
Author: Timm Bäder <mail baedert org>
Date: Thu Feb 28 09:44:08 2019 +0100
roundedrect: Add gsk_rounded_rect_to_string
Keep it private for now, but it's very useful when debugging.
gsk/gskroundedrect.c | 21 +++++++++++++++++++++
gsk/gskroundedrectprivate.h | 2 ++
2 files changed, 23 insertions(+)
---
diff --git a/gsk/gskroundedrect.c b/gsk/gskroundedrect.c
index 4e71e12eab..6498a7c48c 100644
--- a/gsk/gskroundedrect.c
+++ b/gsk/gskroundedrect.c
@@ -535,3 +535,24 @@ gsk_rounded_rect_equal (gconstpointer rect1,
&& graphene_size_equal (&self1->corner[2], &self2->corner[2])
&& graphene_size_equal (&self1->corner[3], &self2->corner[3]);
}
+
+char *
+gsk_rounded_rect_to_string (const GskRoundedRect *self)
+{
+ return g_strdup_printf ("GskRoundedRect %p: Bounds: (%f, %f, %f, %f)"
+ " Corners: (%f, %f) (%f, %f) (%f, %f) (%f, %f)",
+ self,
+ self->bounds.origin.x,
+ self->bounds.origin.y,
+ self->bounds.size.width,
+ self->bounds.size.height,
+ self->corner[0].width,
+ self->corner[0].height,
+ self->corner[1].width,
+ self->corner[1].height,
+ self->corner[2].width,
+ self->corner[2].height,
+ self->corner[3].width,
+ self->corner[3].height);
+
+}
diff --git a/gsk/gskroundedrectprivate.h b/gsk/gskroundedrectprivate.h
index 52d2276fb6..1284d8e7ea 100644
--- a/gsk/gskroundedrectprivate.h
+++ b/gsk/gskroundedrectprivate.h
@@ -16,6 +16,8 @@ void gsk_rounded_rect_to_float (const GskRounde
gboolean gsk_rounded_rect_equal (gconstpointer rect1,
gconstpointer rect2);
+char * gsk_rounded_rect_to_string (const GskRoundedRect *self);
+
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]