Index: cc/layer_tree_host_impl.cc |
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc |
index 4739e9aa36a162bddbfe77b07101393800564c1c..dad0c9684ddbf0e7c3c5b291d0ea48f8c295defd 100644 |
--- a/cc/layer_tree_host_impl.cc |
+++ b/cc/layer_tree_host_impl.cc |
@@ -102,16 +102,15 @@ gfx::RectF PinchZoomViewport::bounds() const |
{ |
gfx::RectF bounds(gfx::PointF(), m_layoutViewportSize); |
bounds.Scale(1 / totalPageScaleFactor()); |
- bounds.Offset(m_pinchViewportScrollDelta); |
+ bounds += m_pinchViewportScrollDelta; |
return bounds; |
} |
gfx::Vector2dF PinchZoomViewport::applyScroll(const gfx::Vector2dF& delta) |
{ |
gfx::Vector2dF overflow; |
- gfx::RectF pinchedBounds = bounds(); |
+ gfx::RectF pinchedBounds = bounds() + delta; |
- pinchedBounds.Offset(delta); |
if (pinchedBounds.x() < 0) { |
overflow.set_x(pinchedBounds.x()); |
pinchedBounds.set_x(0); |
@@ -124,12 +123,12 @@ gfx::Vector2dF PinchZoomViewport::applyScroll(const gfx::Vector2dF& delta) |
if (pinchedBounds.right() > m_layoutViewportSize.width()) { |
overflow.set_x(pinchedBounds.right() - m_layoutViewportSize.width()); |
- pinchedBounds.Offset(m_layoutViewportSize.width() - pinchedBounds.right(), 0); |
+ pinchedBounds += gfx::Vector2d(m_layoutViewportSize.width() - pinchedBounds.right(), 0); |
} |
if (pinchedBounds.bottom() > m_layoutViewportSize.height()) { |
overflow.set_y(pinchedBounds.bottom() - m_layoutViewportSize.height()); |
- pinchedBounds.Offset(0, m_layoutViewportSize.height() - pinchedBounds.bottom()); |
+ pinchedBounds += gfx::Vector2d(0, m_layoutViewportSize.height() - pinchedBounds.bottom()); |
} |
m_pinchViewportScrollDelta = pinchedBounds.OffsetFromOrigin(); |