[clutter/wip/apocalypses/apocalypse-3: 9/35] paint-nodes: Use logical extents for the TextNode::draw



commit 274a45ea5747f977cc1b179d84cc5f5a5f8cf442
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Feb 20 10:09:05 2012 +0000

    paint-nodes: Use logical extents for the TextNode::draw
    
    When we decide if we ought to clip, we should use the logical extents of
    the PangoLayout, just like we do for ClutterText.

 clutter/clutter-paint-nodes.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-paint-nodes.c b/clutter/clutter-paint-nodes.c
index 4a4a6c3..549ef4e 100644
--- a/clutter/clutter-paint-nodes.c
+++ b/clutter/clutter-paint-nodes.c
@@ -701,13 +701,13 @@ static void
 clutter_text_node_draw (ClutterPaintNode *node)
 {
   ClutterTextNode *tnode = CLUTTER_TEXT_NODE (node);
-  PangoRectangle ink_extents;
+  PangoRectangle extents;
   guint i;
 
   if (node->operations == NULL)
     return;
 
-  pango_layout_get_pixel_extents (tnode->layout, &ink_extents, NULL);
+  pango_layout_get_pixel_extents (tnode->layout, NULL, &extents);
 
   for (i = 0; i < node->operations->len; i++)
     {
@@ -727,8 +727,8 @@ clutter_text_node_draw (ClutterPaintNode *node)
            * we clip the layout when drawin, to avoid spilling
            * it out
            */
-          if (ink_extents.width > op_width ||
-              ink_extents.height > op_height)
+          if (extents.width > op_width ||
+              extents.height > op_height)
             {
               cogl_clip_push_rectangle (op->op.texrect[0],
                                         op->op.texrect[1],



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]