[clutter] interactive/content: Define the size of the text geometry
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] interactive/content: Define the size of the text geometry
- Date: Fri, 16 Mar 2012 12:48:25 +0000 (UTC)
commit ff7eb6c0a9b1920678bac45de039331c71f553c1
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Feb 20 10:09:58 2012 +0000
interactive/content: Define the size of the text geometry
So that Clutter can decide whether or not to clip the text properly.
tests/interactive/test-content.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tests/interactive/test-content.c b/tests/interactive/test-content.c
index f8d007a..ecf731d 100644
--- a/tests/interactive/test-content.c
+++ b/tests/interactive/test-content.c
@@ -78,6 +78,8 @@ color_content_paint_content (ClutterContent *content,
/* top-left */
box.x1 = clutter_actor_box_get_x (&content_box);
box.y1 = clutter_actor_box_get_y (&content_box);
+ box.x2 = box.x1 + logical.width;
+ box.y2 = box.y1 + logical.height;
clutter_paint_node_add_rectangle (node, &box);
/* top-right */
@@ -85,6 +87,8 @@ color_content_paint_content (ClutterContent *content,
+ clutter_actor_box_get_width (&content_box)
- logical.width;
box.y1 = clutter_actor_box_get_y (&content_box);
+ box.x2 = box.x1 + logical.width;
+ box.y2 = box.y1 + logical.height;
clutter_paint_node_add_rectangle (node, &box);
/* bottom-right */
@@ -94,6 +98,8 @@ color_content_paint_content (ClutterContent *content,
box.y1 = clutter_actor_box_get_y (&content_box)
+ clutter_actor_box_get_height (&content_box)
- logical.height;
+ box.x2 = box.x1 + logical.width;
+ box.y2 = box.y1 + logical.height;
clutter_paint_node_add_rectangle (node, &box);
/* bottom-left */
@@ -101,6 +107,8 @@ color_content_paint_content (ClutterContent *content,
box.y1 = clutter_actor_box_get_y (&content_box)
+ clutter_actor_box_get_height (&content_box)
- logical.height;
+ box.x2 = box.x1 + logical.width;
+ box.y2 = box.y1 + logical.height;
clutter_paint_node_add_rectangle (node, &box);
/* center */
@@ -108,6 +116,8 @@ color_content_paint_content (ClutterContent *content,
+ (clutter_actor_box_get_width (&content_box) - logical.width) / 2.0;
box.y1 = clutter_actor_box_get_y (&content_box)
+ (clutter_actor_box_get_height (&content_box) - logical.height) / 2.0;
+ box.x2 = box.x1 + logical.width;
+ box.y2 = box.y1 + logical.height;
clutter_paint_node_add_rectangle (node, &box);
clutter_paint_node_add_child (root, node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]