[text] take text padding into account when in single line mode
authorThomas Wood <thomas.wood@intel.com>
Thu, 14 May 2009 08:53:41 +0000 (09:53 +0100)
committerThomas Wood <thomas.wood@intel.com>
Thu, 14 May 2009 12:31:20 +0000 (13:31 +0100)
In single line mode, extra padding is added to the text which must be
taken into account when reporting the natural size of the actor.

clutter/clutter-text.c

index 5b0aa14..6b1d693 100644 (file)
@@ -1439,7 +1439,12 @@ clutter_text_get_preferred_width (ClutterActor *self,
     }
 
   if (natural_width_p)
-    *natural_width_p = layout_width;
+    {
+      if (priv->editable && priv->single_line_mode)
+        *natural_width_p = layout_width + TEXT_PADDING * 2;
+      else
+        *natural_width_p = layout_width;
+    }
 }
 
 static void