diff options
author | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-31 21:20:36 +0000 |
---|---|---|
committer | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-31 21:20:36 +0000 |
commit | f350449c14592107da78883903162945237e94b2 (patch) | |
tree | 41287453c281c56e2bf0823bde920b56a71b2987 /cc/page_scale_animation.cc | |
parent | c0d243a6c23df9983e1ba039bbe760d0cf047ca5 (diff) | |
download | chromium_src-f350449c14592107da78883903162945237e94b2.zip chromium_src-f350449c14592107da78883903162945237e94b2.tar.gz chromium_src-f350449c14592107da78883903162945237e94b2.tar.bz2 |
Fix division by zero error in page_scale_animation
We were hitting this when the initial and the target viewport sizes are equal,
causing a momentary glitch in the animation
BUG=170653
Review URL: https://chromiumcodereview.appspot.com/12082065
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/page_scale_animation.cc')
-rw-r--r-- | cc/page_scale_animation.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cc/page_scale_animation.cc b/cc/page_scale_animation.cc index b8f1fe6..8054318 100644 --- a/cc/page_scale_animation.cc +++ b/cc/page_scale_animation.cc @@ -87,6 +87,11 @@ void PageScaleAnimation::zoomWithAnchor(const gfx::Vector2dF& anchor, float targ // We will interpolate between the two anchors during the animation. inferTargetScrollOffsetFromStartAnchor(); clampTargetScrollOffset(); + + if (m_startPageScaleFactor == m_targetPageScaleFactor) { + m_targetAnchor = m_startAnchor; + return; + } inferTargetAnchorFromScrollOffsets(); } |