mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1030803 - Account for floating-point error in Axis::ScaleWillOverscrollAmount(). r=kats
This commit is contained in:
parent
5861c7b726
commit
de52023c18
@ -272,8 +272,8 @@ float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) {
|
||||
float originAfterScale = (GetOrigin() + aFocus) - (aFocus / aScale);
|
||||
|
||||
bool both = ScaleWillOverscrollBothSides(aScale);
|
||||
bool minus = originAfterScale < GetPageStart();
|
||||
bool plus = (originAfterScale + (GetCompositionLength() / aScale)) > GetPageEnd();
|
||||
bool minus = GetPageStart() - originAfterScale > COORDINATE_EPSILON;
|
||||
bool plus = (originAfterScale + (GetCompositionLength() / aScale)) - GetPageEnd() > COORDINATE_EPSILON;
|
||||
|
||||
if ((minus && plus) || both) {
|
||||
// If we ever reach here it's a bug in the client code.
|
||||
@ -330,7 +330,7 @@ bool Axis::ScaleWillOverscrollBothSides(float aScale) {
|
||||
CSSToParentLayerScale scale(metrics.GetZoomToParent().scale * aScale);
|
||||
CSSRect cssCompositionBounds = metrics.mCompositionBounds / scale;
|
||||
|
||||
return GetRectLength(metrics.GetExpandedScrollableRect()) < GetRectLength(cssCompositionBounds);
|
||||
return GetRectLength(cssCompositionBounds) - GetRectLength(metrics.GetExpandedScrollableRect()) > COORDINATE_EPSILON;
|
||||
}
|
||||
|
||||
const FrameMetrics& Axis::GetFrameMetrics() const {
|
||||
|
Loading…
Reference in New Issue
Block a user