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

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: BottomRight 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
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..9637ae6fc31324b97a3b173edd6ca6def27d5204 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.ClampFromBelow(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.ClampFromAbove(BottomRight(gfx::RectF(scaledContentsSize)) - BottomRight(gfx::Rect(m_deviceViewportSize)));
+ scrollEnd.ClampFromBelow(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') | ui/gfx/point_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698