summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2014-09-01 23:05:30 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-09-01 23:05:30 +0900
commiteb17a036a79fba07176f37f094b608471bb92098 (patch)
tree0a638ba4ec6fdb5409642ee5d50e3c1ce7f5e310 /src/lib
parenta488da49ac277a8caf4a34782a17627ad7e8511d (diff)
label: Fix size calculation for wrapped label
Summary: Label size is incorrectly calculated (text does not wrap) if elm_label_line_wrap_set() is called before elm_label_wrap_width_set(). @fix Test Plan: The label3 test case is added to show the bug case. In label3 test case, if we switch the calling sequence of elm_label_line_wrap_set() and elm_label_wrap_width_set(), the result is different. Reviewers: raster, seoz, woohyun, Hermet Differential Revision: https://phab.enlightenment.org/D1369
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elm_label.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c
index 95da5591b..c206b4738 100644
--- a/src/lib/elm_label.c
+++ b/src/lib/elm_label.c
@@ -39,13 +39,18 @@ _recalc(void *data)
39 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); 39 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
40 40
41 Evas_Coord minw = -1, minh = -1; 41 Evas_Coord minw = -1, minh = -1;
42 Evas_Coord resw; 42 Evas_Coord resw, w;
43 43
44 evas_event_freeze(evas_object_evas_get(data)); 44 evas_event_freeze(evas_object_evas_get(data));
45 evas_object_geometry_get(wd->resize_obj, NULL, NULL, &resw, NULL); 45 edje_object_size_min_calc(wd->resize_obj, &minw, NULL);
46 if (sd->wrap_w > resw) 46 evas_object_geometry_get(wd->resize_obj, NULL, NULL, &w, NULL);
47 resw = sd->wrap_w;
48 47
48 if (sd->wrap_w > minw)
49 resw = sd->wrap_w;
50 else if ((sd->wrap_w > 0) && (minw > sd->wrap_w))
51 resw = minw;
52 else
53 resw = w;
49 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, resw, 0); 54 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, resw, 0);
50 55
51 /* This is a hack to workaround the way min size hints are treated. 56 /* This is a hack to workaround the way min size hints are treated.