mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 20:35:50 +00:00
Bug 1105109 - Add a ScrollByAndClamp() utility function to AsyncPanZoomController. r=kats
MozReview-Commit-ID: GPnuL0kmWsN --HG-- extra : rebase_source : c5773713b1ca8b1b7b95fc476372f0286690e211
This commit is contained in:
parent
9da4eab494
commit
1e610da876
@ -2916,6 +2916,10 @@ void AsyncPanZoomController::ScrollBy(const CSSPoint& aOffset) {
|
||||
mFrameMetrics.ScrollBy(aOffset);
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::ScrollByAndClamp(const CSSPoint& aOffset) {
|
||||
mFrameMetrics.ClampAndSetScrollOffset(mFrameMetrics.GetScrollOffset() + aOffset);
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::ScaleWithFocus(float aScale,
|
||||
const CSSPoint& aFocus) {
|
||||
mFrameMetrics.ZoomBy(aScale);
|
||||
|
@ -532,10 +532,18 @@ protected:
|
||||
nsEventStatus OnCancelTap(const TapGestureInput& aEvent);
|
||||
|
||||
/**
|
||||
* Scrolls the viewport by an X,Y offset.
|
||||
* Scroll the scroll frame by an X,Y offset.
|
||||
* The resulting scroll offset is not clamped to the scrollable rect;
|
||||
* the caller must ensure it stays within range.
|
||||
*/
|
||||
void ScrollBy(const CSSPoint& aOffset);
|
||||
|
||||
/**
|
||||
* Scroll the scroll frame by an X,Y offset, clamping the resulting
|
||||
* scroll offset to the scrollable rect.
|
||||
*/
|
||||
void ScrollByAndClamp(const CSSPoint& aOffset);
|
||||
|
||||
/**
|
||||
* Scales the viewport by an amount (note that it multiplies this scale in to
|
||||
* the current scale, it doesn't set it to |aScale|). Also considers a focus
|
||||
|
Loading…
Reference in New Issue
Block a user