edj_viewer: fix a bug that scale is applied one step after.

Logically, it used previous scale factor in updating live view.
update the scale factor first then update the live view!
This commit is contained in:
Hermet Park 2016-08-06 01:58:58 +09:00
parent 001aae25d8
commit 726eabd442
1 changed files with 3 additions and 2 deletions

View File

@ -786,12 +786,15 @@ view_scale_set(view_data *vd, double scale)
if (!vd || !vd->layout) return;
if (scale == edje_object_scale_get(vd->layout)) return;
vd->view_scale = scale;
int pminw, pminh;
evas_object_size_hint_min_get(vd->layout, &pminw, &pminh);
Evas_Coord sx, sy, sw, sh;
elm_scroller_region_get(vd->scroller, &sx, &sy, &sw, &sh);
edje_object_scale_set(vd->layout, scale);
view_obj_min_update(vd);
//adjust scroller position according to the scale change.
@ -808,8 +811,6 @@ view_scale_set(view_data *vd, double scale)
elm_scroller_region_show(vd->scroller, ((Evas_Coord) cx) - (sw / 2),
((Evas_Coord) cy) - (sh / 2), sw, sh);
vd->view_scale = scale;
}
void