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

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: 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/geometry.h ('k') | cc/layer_tree_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 6bb093b27ce11f51cc24ccf6a29dd848000afe26..fe443e02de04c4e279634f1ca92455895308135f 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698