X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscroll-bar%2Fscroll-bar-impl.cpp;h=1da42973a0623254045d2b87c5adcc9b0d2efa7c;hb=55913cc4a36f6b7171482d01f365c4b67d62660f;hp=5716c5e82a67f6bbe8c44a57bf0a745debb90fe6;hpb=b0115c8f21708cab60e853767d353e35c8b59ebd;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index 5716c5e..1da4297 100644 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -863,42 +863,49 @@ Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction) double ScrollBar::AccessibleImpl::GetMinimum() { - auto p = Toolkit::ScrollBar::DownCast(self); - Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle(); - return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(p).mPropertyMinScrollPosition) : 0.0f; + auto self = Toolkit::ScrollBar::DownCast(Self()); + Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle(); + return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(self).mPropertyMinScrollPosition) : 0.0f; } double ScrollBar::AccessibleImpl::GetCurrent() { - auto p = Toolkit::ScrollBar::DownCast(self); - Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle(); - return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(p).mPropertyScrollPosition) : 0.0f; + auto self = Toolkit::ScrollBar::DownCast(Self()); + Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle(); + return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(self).mPropertyScrollPosition) : 0.0f; } double ScrollBar::AccessibleImpl::GetMaximum() { - auto p = Toolkit::ScrollBar::DownCast(self); - Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle(); - return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(p).mPropertyMaxScrollPosition) : 1.0f; + auto self = Toolkit::ScrollBar::DownCast(Self()); + Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle(); + return scrollableHandle ? scrollableHandle.GetCurrentProperty(GetImpl(self).mPropertyMaxScrollPosition) : 1.0f; } bool ScrollBar::AccessibleImpl::SetCurrent(double current) { if(current < GetMinimum() || current > GetMaximum()) + { return false; + } - auto value_before = GetCurrent(); + auto valueBefore = GetCurrent(); - auto p = Toolkit::ScrollBar::DownCast(self); - Handle scrollableHandle = GetImpl(p).mScrollableObject.GetHandle(); + auto self = Toolkit::ScrollBar::DownCast(Self()); + Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle(); if(!scrollableHandle) + { return false; - scrollableHandle.SetProperty(GetImpl(p).mPropertyScrollPosition, static_cast(current)); + } - auto value_after = GetCurrent(); + scrollableHandle.SetProperty(GetImpl(self).mPropertyScrollPosition, static_cast(current)); - if((current != value_before) && (value_before == value_after)) + auto valueAfter = GetCurrent(); + + if((current != valueBefore) && (valueBefore == valueAfter)) + { return false; + } return true; }