efl_ui_image: keep efl_ui_image size for internal image
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 25 Mar 2020 10:12:16 +0000 (19:12 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Wed, 25 Mar 2020 21:14:08 +0000 (06:14 +0900)
commit06c59e99d1d2a42c9a18784af31bdfb52c313884
tree49675fb4a397b63f8e8c3541d8fc8f8f4eb04243
parent2a0790e7c86e4841a7d18264453cebe9ebeffb47
efl_ui_image: keep efl_ui_image size for internal image

Summary:
The size of internal image could be bigger than the size of efl_ui_image
with following code.

   image = elm_image_add
   elm_image_fill_outside_set(image, EINA_TRUE);

If the internal image object is 300x300, and efl_ui_image is 360x77, then
the internal image object will resize to 360x360 which is bigger than the
size of efl_ui_image.

This is a compatibility issue. This patch will make efl_ui_image work as
before commit 8cb6c3e Elm_image: implement 'scale_type' and 'scalable'...

Test Plan:
This is old example to reproduce the problem.
{F3859361}

This is newly added example to check if this patch breaks compatibility or not.
{F3859390}

You can use the example with following image.
{F3859391}

This is result before applying this patch.
{F3859388}

This is result after applying this patch.
{F3859389}

The translucent rectangle is the size of the efl_ui_image.
As you might be noticed, only FIT_WIDTH (the 4th one of each row),
and EXPAND (the 6th one of each row) are different.

One more difference the 1st one of 2nd row; NONE.

F.Y.I. and for quick understanding of example.
The 1st row efl_ui_image is bigger than internal image.
The 2nd row efl_ui_image is smaller than internal image.
From the left the scale type is NONE, FILL, FIT, FIT_WIDTH,
FIT_HEIGHT, EXPAND, and TILE.

Reviewers: Hermet, jsuya, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11587
src/lib/elementary/efl_ui_image.c