tasn pushed a commit to branch master.

commit 455d8790b9d80430f5ea6a96dd213fbc3c03492f
Author: Tom Hacohen <[email protected]>
Date:   Thu Apr 25 15:16:13 2013 +0100

    Evas textblock: Fixed line size calculation when using multiple fonts.
    
    Thanks to MinSu Seo for reporting.
---
 ChangeLog                                   |  5 +++++
 NEWS                                        |  1 +
 src/lib/evas/canvas/evas_object_textblock.c | 22 +++++++++++++++++++---
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b72e9e8..99adcd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-25  Tom Hacohen
+
+        * Evas textblock: Fixed line size calculation when using multiple
+       fonts.
+
 2013-04-25  Jihoon Kim
 
         * Edje entry: remove duplicated ecore_imf_context_reset in adjusting 
the selection
diff --git a/NEWS b/NEWS
index a62f6d3..e721947 100644
--- a/NEWS
+++ b/NEWS
@@ -255,3 +255,4 @@ Fixes:
     * Edje: When selected word exists, selection is cleared and cursor remains 
on the current entry by additional key input.
     * Ecore-X: Fix selection parser to not overrun buffer read by using longs 
on 64bit.
     * Evas: Fix recursive proxy image rendering to just render black
+    * Evas textblock: Fixed line size calculation when using multiple fonts.
diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 76a9cdb..56d9389 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -3217,6 +3217,17 @@ _layout_line_finalize(Ctxt *c, 
Evas_Object_Textblock_Format *fmt)
                    &c->maxdescent, &fi->y, &fi->parent.w, &fi->parent.h);
              fi->parent.adv = fi->parent.w;
           }
+        else
+          {
+             Evas_Coord asc = 0, desc = 0;
+             _layout_item_ascent_descent_adjust(c->obj, &asc, &desc,
+                   it, c->position);
+
+             if (asc > c->maxascent)
+                c->maxascent = asc;
+             if (desc > c->maxdescent)
+                c->maxdescent = desc;
+          }
 
 loop_advance:
         it->x = x;
@@ -10112,11 +10123,16 @@ _size_native_calc_line_finalize(const Evas_Object 
*eo_obj, Eina_List *items,
 
    if (it)
      {
+        Evas_Coord asc = 0, desc = 0;
         /* If there are no text items yet, calc ascent/descent
          * according to the current format. */
-        if (*ascent + *descent == 0)
-           _layout_item_ascent_descent_adjust(eo_obj, ascent, descent,
-                 it, position);
+        _layout_item_ascent_descent_adjust(eo_obj, &asc, &desc,
+              it, position);
+
+        if (asc > *ascent)
+           *ascent = asc;
+        if (desc > *descent)
+           *descent = desc;
 
         /* Add margins. */
         if (it->format)

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

Reply via email to