summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-12-23 15:42:17 +0900
committerHermet Park <hermetpark@gmail.com>2019-12-23 15:42:17 +0900
commit46ee203331d596ac3aa1ec48b729be42c084088a (patch)
treec8b29cb02b99f545e9cd8006fca1b46c42d8f93c
parentf349510941a81649cbd040774c3d4939429e3293 (diff)
ui image: fix scale_method expand behavior.
As efl_gfx_image_expand specification, it scales the image to cover the entire object area on one axis while maintaining the aspect ratio though image may become larger than the object. Thus, this option must work as one of fit_width / fit_height by detertimining either way. Previously, it was logically wrong. @fix
-rw-r--r--src/lib/elementary/efl_ui_image.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index b110e9d998..213d55edd2 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -215,27 +215,22 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
215 case EFL_GFX_IMAGE_SCALE_METHOD_FIT: 215 case EFL_GFX_IMAGE_SCALE_METHOD_FIT:
216 w = ow; 216 w = ow;
217 h = ((double)ih * w) / (double)iw; 217 h = ((double)ih * w) / (double)iw;
218
219 if (h > oh) 218 if (h > oh)
220 { 219 {
221 h = oh; 220 h = oh;
222 w = ((double)iw * h) / (double)ih; 221 w = ((double)iw * h) / (double)ih;
223 } 222 }
224
225
226 break; 223 break;
227 case EFL_GFX_IMAGE_SCALE_METHOD_FIT_WIDTH: 224 case EFL_GFX_IMAGE_SCALE_METHOD_FIT_WIDTH:
228 w = ow; 225 w = ow;
229 h = ((double)ih * w) / (double)iw; 226 h = ((double)ih * w) / (double)iw;
230
231 break; 227 break;
232 case EFL_GFX_IMAGE_SCALE_METHOD_FIT_HEIGHT: 228 case EFL_GFX_IMAGE_SCALE_METHOD_FIT_HEIGHT:
233 h = oh; 229 h = oh;
234 w = ((double)iw * h) / (double)ih; 230 w = ((double)iw * h) / (double)ih;
235
236 break; 231 break;
237 case EFL_GFX_IMAGE_SCALE_METHOD_EXPAND: 232 case EFL_GFX_IMAGE_SCALE_METHOD_EXPAND:
238 if (ow > oh) 233 if (iw < ih)
239 { 234 {
240 w = ow; 235 w = ow;
241 h = ((double)ih * w) / (double)iw; 236 h = ((double)ih * w) / (double)iw;