diff --git a/ChangeLog b/ChangeLog index 1f70cac0c..3ab6c03a6 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 d09e033ac..29ba417f2 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 39336de59..8aa896acb 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);