| 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 "web/RotationViewportAnchor.h" | 5 #include "web/RotationViewportAnchor.h" |
| 6 | 6 |
| 7 #include "core/dom/ContainerNode.h" | 7 #include "core/dom/ContainerNode.h" |
| 8 #include "core/dom/Node.h" | 8 #include "core/dom/Node.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 inner.setLocation(innerOrigin); | 77 inner.setLocation(innerOrigin); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 RotationViewportAnchor::RotationViewportAnchor( | 82 RotationViewportAnchor::RotationViewportAnchor( |
| 83 FrameView& rootFrameView, | 83 FrameView& rootFrameView, |
| 84 VisualViewport& visualViewport, | 84 VisualViewport& visualViewport, |
| 85 const FloatSize& anchorInInnerViewCoords, | 85 const FloatSize& anchorInInnerViewCoords, |
| 86 PageScaleConstraintsSet& pageScaleConstraintsSet) | 86 PageScaleConstraintsSet& pageScaleConstraintsSet) |
| 87 : ViewportAnchor(rootFrameView, visualViewport) | 87 : m_rootFrameView(&rootFrameView) |
| 88 , m_visualViewport(&visualViewport) |
| 88 , m_anchorInInnerViewCoords(anchorInInnerViewCoords) | 89 , m_anchorInInnerViewCoords(anchorInInnerViewCoords) |
| 89 , m_pageScaleConstraintsSet(pageScaleConstraintsSet) | 90 , m_pageScaleConstraintsSet(pageScaleConstraintsSet) |
| 90 { | 91 { |
| 91 setAnchor(); | 92 setAnchor(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 RotationViewportAnchor::~RotationViewportAnchor() | 95 RotationViewportAnchor::~RotationViewportAnchor() |
| 95 { | 96 { |
| 96 restoreToAnchor(); | 97 restoreToAnchor(); |
| 97 } | 98 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord
s.height()); | 205 anchorOffsetFromNode.scale(m_anchorInNodeCoords.width(), m_anchorInNodeCoord
s.height()); |
| 205 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf
fsetFromNode; | 206 FloatPoint anchorPoint = FloatPoint(currentNodeBounds.location()) + anchorOf
fsetFromNode; |
| 206 | 207 |
| 207 // Compute the new origin point relative to the new anchor point | 208 // Compute the new origin point relative to the new anchor point |
| 208 FloatSize anchorOffsetFromOrigin = innerSize; | 209 FloatSize anchorOffsetFromOrigin = innerSize; |
| 209 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn
nerViewCoords.height()); | 210 anchorOffsetFromOrigin.scale(m_anchorInInnerViewCoords.width(), m_anchorInIn
nerViewCoords.height()); |
| 210 return anchorPoint - anchorOffsetFromOrigin; | 211 return anchorPoint - anchorOffsetFromOrigin; |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace blink | 214 } // namespace blink |
| OLD | NEW |