diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2011-06-24 14:11:24 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2011-06-24 14:11:24 +0000 |
commit | 1724785989b3075613e6253e512780d5db0c7aa4 (patch) | |
tree | 2390c43cb7ae8d424e1c569ed742641904fb72e8 /legacy/emotion/src/lib/emotion_smart.c | |
parent | 923bff4e1cd8afcf9e6157affa989384befd262a (diff) |
emotion: advertise only on frame size change.
SVN revision: 60665
Diffstat (limited to '')
-rw-r--r-- | legacy/emotion/src/lib/emotion_smart.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index f67ec10701..7cfe946d49 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c | |||
@@ -1162,25 +1162,30 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio) | |||
1162 | { | 1162 | { |
1163 | Smart_Data *sd; | 1163 | Smart_Data *sd; |
1164 | int iw, ih; | 1164 | int iw, ih; |
1165 | double tmp; | ||
1165 | int changed = 0; | 1166 | int changed = 0; |
1166 | 1167 | ||
1167 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); | 1168 | E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); |
1168 | evas_object_image_size_get(sd->obj, &iw, &ih); | 1169 | evas_object_image_size_get(sd->obj, &iw, &ih); |
1169 | if ((w != iw) || (h != ih)) | 1170 | if ((w != iw) || (h != ih)) |
1170 | { | 1171 | { |
1171 | if (h > 0) sd->ratio = (double)w / (double)h; | ||
1172 | else sd->ratio = 1.0; | ||
1173 | evas_object_image_size_set(sd->obj, w, h); | 1172 | evas_object_image_size_set(sd->obj, w, h); |
1174 | _emotion_image_data_zero(sd->obj); | 1173 | _emotion_image_data_zero(sd->obj); |
1175 | changed = 1; | 1174 | changed = 1; |
1176 | } | 1175 | } |
1177 | if (ratio != sd->ratio) | 1176 | if (h > 0) tmp = (double)w / (double)h; |
1177 | else tmp = 1.0; | ||
1178 | if (ratio != tmp) tmp = ratio; | ||
1179 | if (tmp != sd->ratio) | ||
1178 | { | 1180 | { |
1179 | sd->ratio = ratio; | 1181 | sd->ratio = tmp; |
1180 | changed = 1; | 1182 | changed = 1; |
1181 | } | 1183 | } |
1182 | if (changed) evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL); | 1184 | if (changed) |
1183 | evas_object_size_hint_request_set(obj, w, h); | 1185 | { |
1186 | evas_object_size_hint_request_set(obj, w, h); | ||
1187 | evas_object_smart_callback_call(obj, SIG_FRAME_RESIZE, NULL); | ||
1188 | } | ||
1184 | } | 1189 | } |
1185 | 1190 | ||
1186 | EAPI void | 1191 | EAPI void |