diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 29461bd476..8d47aeefc8 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1075,3 +1075,8 @@ 2013-02-28 ChunEon Park (Hermet) * Add elm_transit_smooth_set(), elm_transit_smooth_get() + +2013-02-28 Jaehwan Kim + + * Fix the standard of scrollbar-calculation from the scroller's x to pan's x. + The scrollbar have to sync with pan. if not, the scrollbar doesn't move even if the position of content moves. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index c628090531..4d1ebdb77d 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -163,6 +163,7 @@ Fixes: * Fix elm_progressbar_pulse() to abort if pulsing not enabled * Fix scroller acceleration bug. It was accelerated even it's scrolled after finishing the previous scroll. This happens with page scroll enabled. * Fix 1byte invalid read & do memset, rewind if needed. + * Fix the standard of scrollbar-calculation from the scroller's x to pan's x. Removals: diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.c b/legacy/elementary/src/lib/elm_interface_scrollable.c index 5047db9dc1..b4d5e84a81 100644 --- a/legacy/elementary/src/lib/elm_interface_scrollable.c +++ b/legacy/elementary/src/lib/elm_interface_scrollable.c @@ -1450,7 +1450,7 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) Evas_Coord y = va_arg(*list, Evas_Coord); Eina_Bool sig = va_arg(*list, int); - Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 0; + Evas_Coord mx = 0, my = 0, px = 0, py = 0, spx = 0, spy = 0, minx = 0, miny = 0; double vx, vy; Elm_Scrollable_Smart_Interface_Data *sid = _pd; @@ -1460,25 +1460,6 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) // FIXME: allow for bounce outside of range eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my)); eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny)); - - if (mx > 0) vx = (double)(x - minx) / (double)mx; - else vx = 0.0; - - if (vx < 0.0) vx = 0.0; - else if (vx > 1.0) - vx = 1.0; - - if (my > 0) vy = (double)(y - miny) / (double)my; - else vy = 0.0; - - if (vy < 0.0) vy = 0.0; - else if (vy > 1.0) - vy = 1.0; - - edje_object_part_drag_value_set - (sid->edje_obj, "elm.dragable.vbar", 0.0, vy); - edje_object_part_drag_value_set - (sid->edje_obj, "elm.dragable.hbar", vx, 0.0); eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py)); if (!_elm_config->thumbscroll_bounce_enable) { @@ -1500,6 +1481,27 @@ _elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list) } eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y)); + eo_do(sid->pan_obj, elm_obj_pan_pos_get(&spx, &spy)); + + if (mx > 0) vx = (double)(spx - minx) / (double)mx; + else vx = 0.0; + + if (vx < 0.0) vx = 0.0; + else if (vx > 1.0) + vx = 1.0; + + if (my > 0) vy = (double)(spy - miny) / (double)my; + else vy = 0.0; + + if (vy < 0.0) vy = 0.0; + else if (vy > 1.0) + vy = 1.0; + + edje_object_part_drag_value_set + (sid->edje_obj, "elm.dragable.vbar", 0.0, vy); + edje_object_part_drag_value_set + (sid->edje_obj, "elm.dragable.hbar", vx, 0.0); + if (sig && ((px != x) || (py != y))) edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm"); if (!sid->down.bounce_x_animator)