scroller: fix getting content position.
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 25 Aug 2017 05:53:09 +0000 (14:53 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Fri, 25 Aug 2017 05:53:09 +0000 (14:53 +0900)
Summary:
Widgets that don't have content like as genlist, gengrid.
They don't have geometry of content also.
So position of pan will be used when calculating postion to scroll.

Test Plan:
tested in elementary_test and check working properly.
this may be the problem when extern pan set on scrollable interface.

Reviewers: SanghyeonLee, cedric, felipealmeida, larry, bu5hm4n

Reviewed By: SanghyeonLee

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5127

src/lib/elementary/elm_interface_scrollable.c

index cd65b29..152de5f 100644 (file)
@@ -4727,17 +4727,16 @@ EOLIAN static void
 _elm_interface_scrollable_efl_ui_focus_manager_focus_set(Eo *obj, Elm_Scrollable_Smart_Interface_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *focus)
 {
    Eina_Rectangle geom;
-   Eina_Rectangle obj_geom;
+   int pan_x, pan_y;
 
    efl_ui_focus_manager_focus_set(efl_super(obj, MY_SCROLLABLE_INTERFACE), focus);
 
    if (!focus) return;
 
    evas_object_geometry_get(focus, &geom.x, &geom.y, &geom.w, &geom.h);
-   evas_object_geometry_get(pd->content, &obj_geom.x, &obj_geom.y, &obj_geom.w, &obj_geom.h);
-
-   geom.x = geom.x - obj_geom.x;
-   geom.y = geom.y - obj_geom.y;
+   elm_obj_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
+   geom.x = geom.x + pan_x;
+   geom.y = geom.y + pan_y;
 
    elm_interface_scrollable_region_bring_in(obj, geom.x, geom.y, geom.w, geom.h);
 }