forked from enlightenment/efl
Scroller : Fix elm_scroller_last_page_get API wrong return value
Summary: When first page is last page, elm_scroller_last_page_get need to return 0. But if pagesize is bigger then current content height or width, value will be returned -1. So fix this cases to return 0. Test Plan: If set elm_scroller_page_set bigger then current content size, then issue is occurred. Reviewers: seoz, jaehwan, raster Reviewed By: raster Subscribers: eagleeye Differential Revision: https://phab.enlightenment.org/D1860
This commit is contained in:
parent
97e625c68c
commit
db5d4aff45
|
@ -4180,14 +4180,14 @@ _elm_interface_scrollable_last_page_get(Eo *obj EINA_UNUSED, Elm_Scrollable_Smar
|
||||||
eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
|
eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
|
||||||
if (pagenumber_h)
|
if (pagenumber_h)
|
||||||
{
|
{
|
||||||
if (sid->pagesize_h > 0)
|
if ((sid->pagesize_h > 0) && (cw > sid->pagesize_h))
|
||||||
*pagenumber_h = cw / sid->pagesize_h - 1;
|
*pagenumber_h = cw / sid->pagesize_h - 1;
|
||||||
else
|
else
|
||||||
*pagenumber_h = 0;
|
*pagenumber_h = 0;
|
||||||
}
|
}
|
||||||
if (pagenumber_v)
|
if (pagenumber_v)
|
||||||
{
|
{
|
||||||
if (sid->pagesize_v > 0)
|
if ((sid->pagesize_v > 0) && (ch > sid->pagesize_v))
|
||||||
*pagenumber_v = ch / sid->pagesize_v - 1;
|
*pagenumber_v = ch / sid->pagesize_v - 1;
|
||||||
else
|
else
|
||||||
*pagenumber_v = 0;
|
*pagenumber_v = 0;
|
||||||
|
|
Loading…
Reference in New Issue