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

Unified Diff: cc/layer_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: varnames 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_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 10bd1e260f63ae325a98e7bbd3d70fb81547c100..f922dc5141d89c96c407eb1778d6f71454db94d8 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -184,8 +184,8 @@ gfx::Vector2dF LayerImpl::scrollBy(const gfx::Vector2dF& scroll)
gfx::Vector2dF maxDelta = m_maxScrollOffset - m_scrollOffset;
// Clamp newDelta so that position + delta stays within scroll bounds.
gfx::Vector2dF newDelta = (m_scrollDelta + scroll);
- newDelta = ClampFromBelow(newDelta, minDelta);
- newDelta = ClampFromAbove(newDelta, maxDelta);
+ newDelta.ClampToMin(minDelta);
+ newDelta.ClampToMax(maxDelta);
gfx::Vector2dF unscrolled = m_scrollDelta + scroll - newDelta;
if (m_scrollDelta == newDelta)
« no previous file with comments | « cc/geometry.h ('k') | cc/layer_tree_host_impl.cc » ('j') | ui/gfx/vector3d_f.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698