OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double
>(-adjustedDelta))) + 1; | 960 adjustedDelta = static_cast<int>(adjustedDelta * sqrt(static_cast<double
>(-adjustedDelta))) + 1; |
961 | 961 |
962 return adjustedDelta; | 962 return adjustedDelta; |
963 } | 963 } |
964 | 964 |
965 static inline IntSize adjustedScrollDelta(const IntSize& delta) | 965 static inline IntSize adjustedScrollDelta(const IntSize& delta) |
966 { | 966 { |
967 return IntSize(adjustedScrollDelta(delta.width()), adjustedScrollDelta(delta
.height())); | 967 return IntSize(adjustedScrollDelta(delta.width()), adjustedScrollDelta(delta
.height())); |
968 } | 968 } |
969 | 969 |
970 void LayoutBox::panScroll(const IntPoint& sourcePoint) | 970 void LayoutBox::middleClickAutoscroll(const IntPoint& sourcePoint) |
971 { | 971 { |
972 LocalFrame* frame = this->frame(); | 972 LocalFrame* frame = this->frame(); |
973 if (!frame) | 973 if (!frame) |
974 return; | 974 return; |
975 | 975 |
976 IntPoint lastKnownMousePosition = frame->eventHandler().lastKnownMousePositi
on(); | 976 IntPoint lastKnownMousePosition = frame->eventHandler().lastKnownMousePositi
on(); |
977 | 977 |
978 // We need to check if the last known mouse position is out of the window. W
hen the mouse is out of the window, the position is incoherent | 978 // We need to check if the last known mouse position is out of the window. W
hen the mouse is out of the window, the position is incoherent |
979 static IntPoint previousMousePosition; | 979 static IntPoint previousMousePosition; |
980 if (lastKnownMousePosition.x() < 0 || lastKnownMousePosition.y() < 0) | 980 if (lastKnownMousePosition.x() < 0 || lastKnownMousePosition.y() < 0) |
981 lastKnownMousePosition = previousMousePosition; | 981 lastKnownMousePosition = previousMousePosition; |
982 else | 982 else |
983 previousMousePosition = lastKnownMousePosition; | 983 previousMousePosition = lastKnownMousePosition; |
984 | 984 |
985 IntSize delta = lastKnownMousePosition - sourcePoint; | 985 IntSize delta = lastKnownMousePosition - sourcePoint; |
986 | 986 |
987 if (abs(delta.width()) <= AutoscrollController::noPanScrollRadius) // at the
center we let the space for the icon | 987 if (abs(delta.width()) <= AutoscrollController::noMiddleClickAutoscrollRadiu
s) // at the center we let the space for the icon |
988 delta.setWidth(0); | 988 delta.setWidth(0); |
989 if (abs(delta.height()) <= AutoscrollController::noPanScrollRadius) | 989 if (abs(delta.height()) <= AutoscrollController::noMiddleClickAutoscrollRadi
us) |
990 delta.setHeight(0); | 990 delta.setHeight(0); |
991 scroll(ScrollByPixel, FloatSize(adjustedScrollDelta(delta))); | 991 scroll(ScrollByPixel, FloatSize(adjustedScrollDelta(delta))); |
992 } | 992 } |
993 | 993 |
994 void LayoutBox::scrollByRecursively(const DoubleSize& delta, ScrollOffsetClampin
g clamp) | 994 void LayoutBox::scrollByRecursively(const DoubleSize& delta, ScrollOffsetClampin
g clamp) |
995 { | 995 { |
996 if (delta.isZero()) | 996 if (delta.isZero()) |
997 return; | 997 return; |
998 | 998 |
999 bool restrictedByLineClamp = false; | 999 bool restrictedByLineClamp = false; |
(...skipping 3845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4845 m_rareData->m_snapAreas->remove(&snapArea); | 4845 m_rareData->m_snapAreas->remove(&snapArea); |
4846 } | 4846 } |
4847 } | 4847 } |
4848 | 4848 |
4849 SnapAreaSet* LayoutBox::snapAreas() const | 4849 SnapAreaSet* LayoutBox::snapAreas() const |
4850 { | 4850 { |
4851 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4851 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4852 } | 4852 } |
4853 | 4853 |
4854 } // namespace blink | 4854 } // namespace blink |
OLD | NEW |