From ecded5cb7ca6ec079554770927c6f2be815812d0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 20 Dec 2007 09:22:05 +0000 Subject: [PATCH] 2007-12-20 Emmanuele Bassi * clutter/clutter-label.c: (clutter_label_query_coords): Return the bounding box set inside request_coords(), if any; otherwise, return the natural allocation of the label. (#678, reported by Gwenole Beauchesne) * tests/test-rotate.c: Align the label --- ChangeLog | 9 +++++++++ clutter/clutter-label.c | 8 ++++++-- tests/test-rotate.c | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f70cac..3ab6c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-12-20 Emmanuele Bassi + + * clutter/clutter-label.c: + (clutter_label_query_coords): Return the bounding box set inside + request_coords(), if any; otherwise, return the natural allocation + of the label. (#678, reported by Gwenole Beauchesne) + + * tests/test-rotate.c: Align the label + 2007-12-19 Tomas Frydrych * clutter/Makefile.am: diff --git a/clutter/clutter-label.c b/clutter/clutter-label.c index d09e033..29ba417 100644 --- a/clutter/clutter-label.c +++ b/clutter/clutter-label.c @@ -315,6 +315,12 @@ clutter_label_query_coords (ClutterActor *self, priv = label->priv; + if ((priv->allocation.x2 - priv->allocation.x1) > 0) + { + *box = priv->allocation; + return; + } + if (priv->wrap) clutter_label_clear_layout (label); @@ -324,8 +330,6 @@ clutter_label_query_coords (ClutterActor *self, box->x2 = box->x1 + CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.width); box->y2 = box->y1 + CLUTTER_UNITS_FROM_PANGO_UNIT (logical_rect.height); - - return; } static void diff --git a/tests/test-rotate.c b/tests/test-rotate.c index 39336de..8aa896a 100644 --- a/tests/test-rotate.c +++ b/tests/test-rotate.c @@ -36,6 +36,7 @@ main (int argc, char *argv[]) clutter_container_add_actor (CLUTTER_CONTAINER (stage), hand); label = clutter_label_new_with_text ("Mono 16", "The Wonder of the Spinning Hand"); + clutter_label_set_alignment (CLUTTER_LABEL (label), PANGO_ALIGN_CENTER); clutter_actor_set_position (label, 150, 150); clutter_actor_show (label); clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); -- 2.7.4