[problem] Scrolling could result in page disappearing during scrolling due to incorrect scroll domain (change homescreen scroll effect to outer cube/spiral)
[solution] Added code to deal with ruler being disabled, now the min/max values for that ruler are reset to 0
Change-Id: I34e95761fb58dfe4d2bc3580671415f1f6f2e707
Signed-off-by: Julien Heanley <j.heanley@partner.samsung.com>
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
mWrapMode(false),
mAxisAutoLock(false),
mAlterChild(false),
mWrapMode(false),
mAxisAutoLock(false),
mAlterChild(false),
- mDefaultMaxOvershoot(true)
+ mDefaultMaxOvershoot(true),
+ mCanScrollHorizontal(true),
+ mCanScrollVertical(true)
{
SetRequiresMouseWheelEvents(true);
}
{
SetRequiresMouseWheelEvents(true);
}
if(mRulerX->IsEnabled())
{
const Toolkit::RulerDomain& rulerDomain = mRulerX->GetDomain();
if(mRulerX->IsEnabled())
{
const Toolkit::RulerDomain& rulerDomain = mRulerX->GetDomain();
- if( fabsf(min.x - rulerDomain.min) > Math::MACHINE_EPSILON_10000
- || fabsf(max.x - rulerDomain.max) > Math::MACHINE_EPSILON_10000 )
+ if( fabsf(min.x - rulerDomain.min) > Math::MACHINE_EPSILON_100
+ || fabsf(max.x - rulerDomain.max) > Math::MACHINE_EPSILON_100 )
{
domainChanged = true;
min.x = rulerDomain.min;
{
domainChanged = true;
min.x = rulerDomain.min;
mScrollPrePosition.x = Clamp(mScrollPrePosition.x, -(max.x - size.x), -min.x);
}
}
mScrollPrePosition.x = Clamp(mScrollPrePosition.x, -(max.x - size.x), -min.x);
}
}
- if( (fabsf(rulerDomain.max - rulerDomain.min) - size.x) > Math::MACHINE_EPSILON_10000 )
+ if( (fabsf(rulerDomain.max - rulerDomain.min) - size.x) > Math::MACHINE_EPSILON_100 )
{
canScrollHorizontal = true;
}
}
{
canScrollHorizontal = true;
}
}
+ else if( fabs(min.x) > Math::MACHINE_EPSILON_100
+ || fabs(max.x) > Math::MACHINE_EPSILON_100 )
+ {
+ // need to reset to 0
+ domainChanged = true;
+ min.x = 0.0f;
+ max.x = 0.0f;
+ canScrollHorizontal = false;
+ }
if(mRulerY->IsEnabled())
{
const Toolkit::RulerDomain& rulerDomain = mRulerY->GetDomain();
if(mRulerY->IsEnabled())
{
const Toolkit::RulerDomain& rulerDomain = mRulerY->GetDomain();
- if( fabsf(min.y - rulerDomain.min) > Math::MACHINE_EPSILON_10000
- || fabsf(max.y - rulerDomain.max) > Math::MACHINE_EPSILON_10000 )
+ if( fabsf(min.y - rulerDomain.min) > Math::MACHINE_EPSILON_100
+ || fabsf(max.y - rulerDomain.max) > Math::MACHINE_EPSILON_100 )
{
domainChanged = true;
min.y = rulerDomain.min;
{
domainChanged = true;
min.y = rulerDomain.min;
mScrollPrePosition.y = Clamp(mScrollPrePosition.y, -(max.y - size.y), -min.y);
}
}
mScrollPrePosition.y = Clamp(mScrollPrePosition.y, -(max.y - size.y), -min.y);
}
}
- if( (fabsf(rulerDomain.max - rulerDomain.min) - size.y) > Math::MACHINE_EPSILON_10000 )
+ if( (fabsf(rulerDomain.max - rulerDomain.min) - size.y) > Math::MACHINE_EPSILON_100 )
{
canScrollVertical = true;
}
}
{
canScrollVertical = true;
}
}
+ else if( fabs(min.y) > Math::MACHINE_EPSILON_100
+ || fabs(max.y) > Math::MACHINE_EPSILON_100 )
+ {
+ // need to reset to 0
+ domainChanged = true;
+ min.y = 0.0f;
+ max.y = 0.0f;
+ canScrollHorizontal = false;
+ }
+
// avoid setting properties if possible, otherwise this will cause an entire update as well as triggering constraints using each property we update
// avoid setting properties if possible, otherwise this will cause an entire update as well as triggering constraints using each property we update
- if( self.GetProperty<bool>(mPropertyCanScrollVertical) != canScrollVertical )
+ if( mCanScrollVertical != canScrollVertical )
+ mCanScrollVertical = canScrollVertical;
self.SetProperty(mPropertyCanScrollVertical, canScrollVertical);
}
self.SetProperty(mPropertyCanScrollVertical, canScrollVertical);
}
- if( self.GetProperty<bool>(mPropertyCanScrollHorizontal) != canScrollHorizontal )
+ if( mCanScrollHorizontal != canScrollHorizontal )
+ mCanScrollHorizontal = canScrollHorizontal;
self.SetProperty(mPropertyCanScrollHorizontal, canScrollHorizontal);
}
if( scrollPositionChanged )
self.SetProperty(mPropertyCanScrollHorizontal, canScrollHorizontal);
}
if( scrollPositionChanged )
{
mMinScroll = min;
mMaxScroll = max;
{
mMinScroll = min;
mMaxScroll = max;
- self.SetProperty(mPropertyPositionMin, min );
- self.SetProperty(mPropertyPositionMax, max );
+ self.SetProperty(mPropertyPositionMin, mMinScroll );
+ self.SetProperty(mPropertyPositionMax, mMaxScroll );
bool mAlterChild:1; ///< Internal flag to control behavior of OnChildAdd/OnChildRemove when Adding internal Actors.
bool mDefaultMaxOvershoot:1; ///< Whether to use default max overshoot or application defined one
bool mUserSetPosition:1; ///< SetScrollPosition has been called, return this position until internals get control of scroll position again
bool mAlterChild:1; ///< Internal flag to control behavior of OnChildAdd/OnChildRemove when Adding internal Actors.
bool mDefaultMaxOvershoot:1; ///< Whether to use default max overshoot or application defined one
bool mUserSetPosition:1; ///< SetScrollPosition has been called, return this position until internals get control of scroll position again
+ bool mCanScrollHorizontal:1; ///< Local value of our property to check against
+ bool mCanScrollVertical:1; ///< Local value of our property to check against
};
} // namespace Internal
};
} // namespace Internal