focus: modify a formula to calculate focus region to show

if there was a spacer around elm.swallow.content of scroller,
position of pan object would be different with position of the scroller obj.

this patch modifies a fomular that calculates some points relative to scroller
to a fomular that calculates the points relative to pan obj.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10745
This commit is contained in:
Wonki Kim 2019-12-06 08:29:26 +00:00 committed by Marcel Hollerbach
parent 1aa5b0c2e8
commit 2c515628d3
1 changed files with 7 additions and 4 deletions

View File

@ -1128,12 +1128,15 @@ elm_widget_focus_region_show(Eo *obj)
if (_elm_scrollable_is(o) && !elm_widget_disabled_get(o))
{
Evas_Coord sx, sy;
elm_interface_scrollable_content_region_get(o, &sx, &sy, NULL, NULL);
Evas_Coord vx, vy;
// Get the object's on_focus_region position relative to the scroller.
elm_interface_scrollable_content_region_get(o, &sx, &sy, NULL, NULL);
elm_interface_scrollable_content_viewport_geometry_get(o, &vx, &vy, NULL, NULL);
// Get the object's on_focus_region position relative to the pan in the scroller.
Evas_Coord rx, ry;
rx = ox + r.x - px + sx;
ry = oy + r.y - py + sy;
rx = ox + r.x - vx + sx;
ry = oy + r.y - vy + sy;
switch (_elm_config->focus_autoscroll_mode)
{