From 4489f92cf361a53fc8a92c2ab475f579fcaf073c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 12 Jun 2011 14:12:52 +0000 Subject: [PATCH] Edje text: Fix a rare issue causing ellipsis not to work. SVN revision: 60240 --- legacy/edje/ChangeLog | 4 ++++ legacy/edje/src/lib/edje_text.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/legacy/edje/ChangeLog b/legacy/edje/ChangeLog index 9ec78560d2..671c09ffb0 100644 --- a/legacy/edje/ChangeLog +++ b/legacy/edje/ChangeLog @@ -119,3 +119,7 @@ * Fix external usage in sub group to have the proper parents. +2011-06-11 Tom Hacohen (TAsn) + + * Fix an issue with ellipsis not working properly with small + text parts. diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c index c29cbe7a8f..a2038d057a 100644 --- a/legacy/edje/src/lib/edje_text.c +++ b/legacy/edje/src/lib/edje_text.c @@ -148,9 +148,14 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep, uc1 = evas_object_text_last_up_to_pos(ep->object, -p + l, th / 2); if (params->type.text.elipsis != 1.0) - /* should be the last in text! not the rightmost */ - uc2 = evas_object_text_last_up_to_pos(ep->object, - -p + sw - r, th / 2); + { + /* should be the last in text! not the rightmost */ + if ((-p + sw -r) < 0) + uc2 = evas_object_text_last_up_to_pos(ep->object, 0, th / 2); + else + uc2 = evas_object_text_last_up_to_pos(ep->object, + -p + sw - r, th / 2); + } if ((uc1 < 0) && (uc2 < 0)) { uc1 = 0;