Changeset 173640 in webkit
- Timestamp:
- Sep 15, 2014 5:41:36 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r173547 r173640 1 2014-09-15 Matt Baker <mattbaker@apple.com> 2 3 Web Inspector: mouse drifts away from resizer when resizing docked inspector 4 https://bugs.webkit.org/show_bug.cgi?id=22263 5 6 Reviewed by Joseph Pecoraro. 7 8 Modified the docked resizer dragging logic to record the initial mouse down position relative to the 9 resizer client rectangle. Added check while dragging the resizer to ensure that the cursor is positioned 10 correctly with respect to the resize direction before updating the attached window dimension. 11 12 * UserInterface/Base/Main.js: 13 (WebInspector._dockedResizerMouseDown.dockedResizerDrag): 14 1 15 2014-09-11 Joseph Pecoraro <pecoraro@apple.com> 2 16 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r173494 r173640 1282 1282 1283 1283 var windowProperty = this._dockSide === "bottom" ? "innerHeight" : "innerWidth"; 1284 var eventProperty = this._dockSide === "bottom" ? "screenY" : "screenX"; 1284 var eventScreenProperty = this._dockSide === "bottom" ? "screenY" : "screenX"; 1285 var eventClientProperty = this._dockSide === "bottom" ? "clientY" : "clientX"; 1285 1286 1286 1287 var resizerElement = event.target; 1287 var lastScreenPosition = event[eventProperty]; 1288 var firstClientPosition = event[eventClientProperty]; 1289 var lastScreenPosition = event[eventScreenProperty]; 1288 1290 1289 1291 function dockedResizerDrag(event) … … 1292 1294 return; 1293 1295 1294 var position = event[eventProperty]; 1295 var dimension = window[windowProperty] - (position - lastScreenPosition); 1296 var position = event[eventScreenProperty]; 1297 var delta = position - lastScreenPosition; 1298 var clientPosition = event[eventClientProperty]; 1299 1300 lastScreenPosition = position; 1301 1302 // If delta is positive the docked Inspector size is decreasing, in which case the cursor client position 1303 // with respect to the target cannot be less than the first mouse down position within the target. 1304 if (delta > 0 && clientPosition < firstClientPosition) 1305 return; 1306 1307 // If delta is negative the docked Inspector size is increasing, in which case the cursor client position 1308 // with respect to the target cannot be greater than the first mouse down position within the target. 1309 if (delta < 0 && clientPosition > firstClientPosition) 1310 return; 1311 1312 var dimension = Math.max(0, window[windowProperty] - delta); 1296 1313 1297 1314 if (this._dockSide === "bottom") … … 1299 1316 else 1300 1317 InspectorFrontendHost.setAttachedWindowWidth(dimension); 1301 1302 lastScreenPosition = position;1303 1318 } 1304 1319
Note: See TracChangeset
for help on using the changeset viewer.