Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: cc/layer_tree_host_impl.cc

Issue 11361186: ui: Add methods to clamp Sizes, Points, and Vectors from above or below. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/page_scale_animation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_host_impl.cc
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index cdd69954b01b547a5a39db34fec852bbaf3588ce..a12a4e84a6c13fe2c14ee3d458c7840d2cb99b7a 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -1012,7 +1012,7 @@ void LayerTreeHostImpl::updateMaxScrollOffset()
// The viewport may be larger than the contents in some cases, such as
// having a vertical scrollbar but no horizontal overflow.
- maxScroll = ClampFromBelow(maxScroll, gfx::Vector2dF());
+ maxScroll.ClampToMin(gfx::Vector2dF());
m_rootScrollLayerImpl->setMaxScrollOffset(gfx::ToFlooredVector2d(maxScroll));
}
@@ -1300,8 +1300,8 @@ void LayerTreeHostImpl::computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo)
gfx::Vector2dF scrollEnd = scrollBegin + anchorOffset;
scrollEnd.Scale(m_pinchZoomViewport.minPageScaleFactor() / scaleBegin);
scrollEnd -= anchorOffset;
- scrollEnd = ClampFromAbove(scrollEnd, BottomRight(gfx::RectF(scaledContentsSize)) - BottomRight(gfx::Rect(m_deviceViewportSize)));
- scrollEnd = ClampFromBelow(scrollEnd, gfx::Vector2d());
+ scrollEnd.ClampToMax(BottomRight(gfx::RectF(scaledContentsSize)) - BottomRight(gfx::Rect(m_deviceViewportSize)));
+ scrollEnd.ClampToMin(gfx::Vector2d());
scrollEnd.Scale(1 / pageScaleDeltaToSend);
scrollEnd.Scale(m_deviceScaleFactor);
« no previous file with comments | « cc/layer_impl.cc ('k') | cc/page_scale_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698