| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "web/RotationViewportAnchor.h" | 6 #include "web/RotationViewportAnchor.h" |
| 7 | 7 |
| 8 #include "core/dom/ContainerNode.h" | 8 #include "core/dom/ContainerNode.h" |
| 9 #include "core/dom/Node.h" | 9 #include "core/dom/Node.h" |
| 10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
| 11 #include "core/frame/LocalFrame.h" | 11 #include "core/frame/LocalFrame.h" |
| 12 #include "core/frame/PageScaleConstraintsSet.h" | 12 #include "core/frame/PageScaleConstraintsSet.h" |
| 13 #include "core/frame/PinchViewport.h" | 13 #include "core/frame/PinchViewport.h" |
| 14 #include "core/input/EventHandler.h" |
| 14 #include "core/layout/HitTestResult.h" | 15 #include "core/layout/HitTestResult.h" |
| 15 #include "core/page/EventHandler.h" | |
| 16 #include "platform/geometry/DoubleRect.h" | 16 #include "platform/geometry/DoubleRect.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 static const float viewportAnchorRelativeEpsilon = 0.1f; | 22 static const float viewportAnchorRelativeEpsilon = 0.1f; |
| 23 static const int viewportToNodeMaxRelativeArea = 2; | 23 static const int viewportToNodeMaxRelativeArea = 2; |
| 24 | 24 |
| 25 template <typename RectType> | 25 template <typename RectType> |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord
s.height()); | 205 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord
s.height()); |
| 206 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf
fsetFromNode; | 206 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf
fsetFromNode; |
| 207 | 207 |
| 208 // Compute the new origin point relative to the new anchor point | 208 // Compute the new origin point relative to the new anchor point |
| 209 FloatSize anchorOffsetFromOrigin = innerSize; | 209 FloatSize anchorOffsetFromOrigin = innerSize; |
| 210 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn
nerViewCoords.height()); | 210 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn
nerViewCoords.height()); |
| 211 return anchorPoint - anchorOffsetFromOrigin; | 211 return anchorPoint - anchorOffsetFromOrigin; |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |