tasn pushed a commit to branch evas-1.7.
commit 2a07da3153aeacea498c17c9575e9187863ae9c6
Author: Tom Hacohen <[email protected]>
Date: Thu Apr 25 15:24:59 2013 +0100
Textblock: Fixed line size calculation when using multiple fonts.
Thanks to MinSu Seo for reporting.
---
ChangeLog | 4 ++++
NEWS | 1 +
src/lib/canvas/evas_object_textblock.c | 22 +++++++++++++++++++---
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ec35d8a..327416d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1285,3 +1285,7 @@
2013-04-22 Mike Blumenkrantz
* Fix recursive proxy image rendering to just render black
+
+2013-04-25 Tom Hacohen
+
+ * Evas textblock: Fixed line size calculation when using multiple
fonts.
diff --git a/NEWS b/NEWS
index 5911ddc..ce68a26 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ Evas 1.7.6
* Evas cache: remove the freed worker from the pthread worker list when
it's failed to create a new thread so as not to access it if a thread is
working newly.
* Fix evas word start/end find in textblock to be consistent with other
toolkit logic on the matter
* Fix crash in Evas Buffer engine when using output with no alpha.
+ * Evas textblock: Fixed line size calculation when using multiple fonts.
Changes since Evas 1.7.5:
-------------------------
diff --git a/src/lib/canvas/evas_object_textblock.c
b/src/lib/canvas/evas_object_textblock.c
index cd7bb32..531fc2e 100644
--- a/src/lib/canvas/evas_object_textblock.c
+++ b/src/lib/canvas/evas_object_textblock.c
@@ -3187,6 +3187,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_format_ascent_descent_adjust(c->obj, &asc, &desc,
+ it->format);
+
+ if (asc > c->maxascent)
+ c->maxascent = asc;
+ if (desc > c->maxdescent)
+ c->maxdescent = desc;
+ }
loop_advance:
it->x = x;
@@ -9691,11 +9702,16 @@ _size_native_calc_line_finalize(const Evas_Object *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_format_ascent_descent_adjust(obj, ascent, descent,
- it->format);
+ _layout_format_ascent_descent_adjust(obj, &asc, &desc,
+ it->format);
+
+ 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