summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2020-12-07 16:52:54 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2020-12-07 16:53:08 +0900
commit25dba9ebcf7b5a1329d6d716b0fb783883e4a6d6 (patch)
treec81386313d26d44b0e55074520e9dc95972035c5 /src/modules
parent1aef7c697ab538e73c90617fb872bcf595ccf7c1 (diff)
downloadefl-25dba9ebcf7b5a1329d6d716b0fb783883e4a6d6.tar.gz
png: handle 9-patch ends with stretch
Summary: The strech region has paired information; total and strechable. Refer to function _strech_region_load retrieving strech region info. But if 9-patch information line ends with strechable, png did not push the strechable information. And it leads to devide by zero. This patch is adding strechable info to the strech region, if 9-patch information ends with strechable. Test Plan: [Code] {F4219278} {F4219280} [Test] ECORE_EVAS_ENGINE=opengl_x11 ./evas-image-9patch ./end_with_strech.9.png Reviewers: Hermet, jsuya, herb, cedric Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12204
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/image_loaders/png/evas_image_load_png.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c
index ce55916b0e..9e5073cc5b 100644
--- a/src/modules/evas/image_loaders/png/evas_image_load_png.c
+++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c
@@ -473,6 +473,13 @@ evas_image_load_file_head_with_data_png(void *loader_data,
evas_loader_helper_stretch_region_push(&prop->stretch.horizontal.region,
&current, stretchable);
}
+ // End with strechable, add length info
+ if (stretchable)
+ {
+ evas_loader_helper_stretch_region_push(&prop->stretch.horizontal.region,
+ &current, stretchable);
+ stretchable = !stretchable;
+ }
current = 0;
@@ -513,6 +520,13 @@ evas_image_load_file_head_with_data_png(void *loader_data,
evas_loader_helper_stretch_region_push(&prop->stretch.vertical.region,
&current, stretchable);
}
+ // End with strechable, add length info
+ if (stretchable)
+ {
+ evas_loader_helper_stretch_region_push(&prop->stretch.vertical.region,
+ &current, stretchable);
+ stretchable = !stretchable;
+ }
// Content zone is optional, if not provided, we should use the one we guessed
if (prop->content.x == 0 || prop->content.y == 0)