Changeset 163323 in webkit
- Timestamp:
- Feb 3, 2014 1:46:46 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r163311 r163323 1 2014-02-03 Tim Horton <timothy_horton@apple.com> 2 3 WebKit2 View Gestures: Two smart magnifications in a row without moving the mouse should zoom out 4 https://bugs.webkit.org/show_bug.cgi?id=128108 5 <rdar://problem/15914539> 6 7 Reviewed by Darin Adler. 8 9 * UIProcess/mac/ViewGestureController.h: 10 * UIProcess/mac/ViewGestureController.mm: 11 (WebKit::ViewGestureController::ViewGestureController): 12 (WebKit::ViewGestureController::handleMagnificationGesture): 13 Clear the bit that tells us that we should do "smart" things (because the 14 last gesture was also a smart magnification gesture) when the user manually pinch-magnifies. 15 16 (WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture): 17 Zoom out if the mouse hasn't moved since the last pinch-magnification gesture. 18 19 1 20 2014-02-03 Darin Adler <darin@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h
r163093 r163323 101 101 102 102 WebCore::FloatRect m_lastSmartMagnificationUnscaledTargetRect; 103 bool m_lastSmartMagnificationUnscaledTargetRectIsValid; 103 bool m_lastMagnificationGestureWasSmartMagnification; 104 WebCore::FloatPoint m_lastSmartMagnificationOrigin; 104 105 105 106 ViewGestureType m_activeGestureType; -
trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.mm
r163192 r163323 94 94 ViewGestureController::ViewGestureController(WebPageProxy& webPageProxy) 95 95 : m_webPageProxy(webPageProxy) 96 , m_last SmartMagnificationUnscaledTargetRectIsValid(false)96 , m_lastMagnificationGestureWasSmartMagnification(false) 97 97 , m_activeGestureType(ViewGestureType::None) 98 98 , m_visibleContentRectIsValid(false) … … 154 154 m_magnification = m_webPageProxy.pageScaleFactor(); 155 155 m_webPageProxy.process().send(Messages::ViewGestureGeometryCollector::CollectGeometryForMagnificationGesture(), m_webPageProxy.pageID()); 156 m_lastMagnificationGestureWasSmartMagnification = false; 156 157 157 158 return; … … 226 227 227 228 // Allow panning between elements via double-tap while magnified, unless the target rect is 228 // similar to the last one, in which case we'll zoom all the way out. 229 if (currentScaleFactor > 1 230 && m_lastSmartMagnificationUnscaledTargetRectIsValid 231 && maximumRectangleComponentDelta(m_lastSmartMagnificationUnscaledTargetRect, unscaledTargetRect) < smartMagnificationPanScrollThreshold) 232 targetMagnification = 1; 229 // similar to the last one or the mouse has not moved, in which case we'll zoom all the way out. 230 if (currentScaleFactor > 1 && m_lastMagnificationGestureWasSmartMagnification) { 231 if (maximumRectangleComponentDelta(m_lastSmartMagnificationUnscaledTargetRect, unscaledTargetRect) < smartMagnificationPanScrollThreshold) 232 targetMagnification = 1; 233 234 if (m_lastSmartMagnificationOrigin == origin) 235 targetMagnification = 1; 236 } 233 237 234 238 FloatRect targetRect(unscaledTargetRect); … … 241 245 242 246 m_lastSmartMagnificationUnscaledTargetRect = unscaledTargetRect; 243 m_lastSmartMagnificationUnscaledTargetRectIsValid = true; 247 m_lastSmartMagnificationOrigin = origin; 248 249 m_lastMagnificationGestureWasSmartMagnification = true; 244 250 } 245 251
Note: See TracChangeset
for help on using the changeset viewer.