summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-03-09 17:54:33 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2020-03-09 17:54:33 +0900
commitd60587c0989c0cbd8cbb17a0a19854f00495a702 (patch)
treee7071a8bf7db066c02c8af5a027bc322afad8a72 /src
parentc6e40641aabfb55b4d93a06054ec68fec07615b8 (diff)
Efl.Ui.Image: Modify current frame to start at 1
Summary: 3dc3deb patch was changed to start at 1 rather than 0. gif image starts at 1, not 0. Test Plan: N/A Reviewers: Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11474
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_image.c10
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 285927c7f0..2684b0f364 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -1753,7 +1753,7 @@ _efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool an
1753 if (anim) 1753 if (anim)
1754 { 1754 {
1755 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img); 1755 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
1756 sd->cur_frame = 0; 1756 sd->cur_frame = 1;
1757 sd->frame_duration = 1757 sd->frame_duration =
1758 evas_object_image_animated_frame_duration_get 1758 evas_object_image_animated_frame_duration_get
1759 (sd->img, sd->cur_frame, 0); 1759 (sd->img, sd->cur_frame, 0);
@@ -1860,7 +1860,7 @@ _efl_ui_image_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui
1860 if (sd->edje) 1860 if (sd->edje)
1861 efl_player_playback_progress_get(sd->img); 1861 efl_player_playback_progress_get(sd->img);
1862 else if (sd->frame_count > 1) 1862 else if (sd->frame_count > 1)
1863 return (double)sd->cur_frame / ((double)sd->frame_count - 1.0); 1863 return ((double)sd->cur_frame - 1.0) / ((double)sd->frame_count - 1.0);
1864 return 0.0; 1864 return 0.0;
1865} 1865}
1866 1866
@@ -1870,10 +1870,10 @@ _efl_ui_image_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Image
1870 EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0); 1870 EINA_SAFETY_ON_TRUE_RETURN(progress > 1 || progress < 0);
1871 if (sd->edje) 1871 if (sd->edje)
1872 efl_player_playback_progress_set(sd->img, progress); 1872 efl_player_playback_progress_set(sd->img, progress);
1873 else if (sd->frame_count > 1) 1873 else if (sd->frame_count > 0)
1874 sd->cur_frame = lround(progress * (sd->frame_count - 1)); 1874 sd->cur_frame = (lround(progress * (sd->frame_count - 1)) + 1);
1875 else 1875 else
1876 sd->cur_frame = 0; 1876 sd->cur_frame = 1;
1877} 1877}
1878 1878
1879static Eina_Bool 1879static Eina_Bool
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index e71f72b166..55c2daab41 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -3037,7 +3037,7 @@ _efl_ui_image_zoomable_animated_set_internal(Eo *obj EINA_UNUSED, Efl_Ui_Image_Z
3037 if (anim) 3037 if (anim)
3038 { 3038 {
3039 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img); 3039 sd->frame_count = evas_object_image_animated_frame_count_get(sd->img);
3040 sd->cur_frame = 0; 3040 sd->cur_frame = 1;
3041 sd->frame_duration = 3041 sd->frame_duration =
3042 evas_object_image_animated_frame_duration_get 3042 evas_object_image_animated_frame_duration_get
3043 (sd->img, sd->cur_frame, 0); 3043 (sd->img, sd->cur_frame, 0);
@@ -3158,7 +3158,7 @@ _efl_ui_image_zoomable_efl_player_playback_progress_get(const Eo *obj EINA_UNUSE
3158 if (sd->edje) 3158 if (sd->edje)
3159 efl_player_playback_progress_get(sd->edje); 3159 efl_player_playback_progress_get(sd->edje);
3160 else if (sd->frame_count > 1) 3160 else if (sd->frame_count > 1)
3161 return (double)sd->cur_frame / ((double)sd->frame_count - 1.0); 3161 return ((double)sd->cur_frame - 1.0) / ((double)sd->frame_count - 1.0);
3162 return 0.0; 3162 return 0.0;
3163} 3163}
3164 3164
@@ -3170,10 +3170,10 @@ _efl_ui_image_zoomable_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl
3170 { 3170 {
3171 efl_player_playback_progress_set(sd->img, progress); 3171 efl_player_playback_progress_set(sd->img, progress);
3172 } 3172 }
3173 else if (sd->frame_count > 1) 3173 else if (sd->frame_count > 0)
3174 sd->cur_frame = lround(progress * (sd->frame_count - 1)); 3174 sd->cur_frame = (lround(progress * (sd->frame_count - 1)) + 1);
3175 else 3175 else
3176 sd->cur_frame = 0; 3176 sd->cur_frame = 1;
3177} 3177}
3178 3178
3179EOLIAN static void 3179EOLIAN static void