Changeset 234021 in webkit
- Timestamp:
- Jul 19, 2018 9:29:21 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r233989 r234021 1 2018-07-19 Ross Kirsling <ross.kirsling@sony.com> 2 3 Web Inspector: Layers visualization shouldn't select on mousedown 4 https://bugs.webkit.org/show_bug.cgi?id=187488 5 6 Reviewed by Matt Baker. 7 8 * UserInterface/Views/Layers3DContentView.js: 9 (WI.Layers3DContentView): 10 (WI.Layers3DContentView.prototype.initialLayout): 11 (WI.Layers3DContentView.prototype._canvasMouseDown): 12 (WI.Layers3DContentView.prototype._canvasMouseUp): 13 Don't update selection on mousedown, update on mouseup! 14 Specifically, only update when mousedown & mouseup targets are the same and mousemove hasn't been triggered. 15 1 16 2018-07-19 Nikita Vasilyev <nvasilyev@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js
r233695 r234021 46 46 this._layerGroupsById = new Map; 47 47 this._selectedLayerGroup = null; 48 this._candidateSelection = null; 48 49 this._nodeToSelect = null; 49 50 … … 54 55 this._boundingBox = null; 55 56 this._raycaster = null; 56 this._mouse = null;57 57 this._animationFrameRequestId = null; 58 58 this._documentNode = null; … … 165 165 166 166 this._raycaster = new THREE.Raycaster; 167 this._mouse = new THREE.Vector2;168 167 this._renderer.domElement.addEventListener("mousedown", this._canvasMouseDown.bind(this)); 168 this._renderer.domElement.addEventListener("mouseup", this._canvasMouseUp.bind(this)); 169 169 170 170 this.element.appendChild(this._renderer.domElement); … … 311 311 _canvasMouseDown(event) 312 312 { 313 this._mouse.x = (event.offsetX / event.target.width) * 2 - 1;314 this._mouse.y = -(event.offsetY / event.target.height) * 2 + 1;315 this._raycaster.setFromCamera( this._mouse, this._camera);313 let x = (event.offsetX / event.target.offsetWidth) * 2 - 1; 314 let y = -(event.offsetY / event.target.offsetHeight) * 2 + 1; 315 this._raycaster.setFromCamera(new THREE.Vector2(x, y), this._camera); 316 316 317 317 const recursive = true; 318 318 let intersects = this._raycaster.intersectObjects(this._scene.children, recursive); 319 let selection = intersects.length ? intersects[0].object.parent : null; 319 let layerGroup = intersects.length ? intersects[0].object.parent : null; 320 this._candidateSelection = {layerGroup}; 321 322 let canvasMouseMove = (event) => { 323 this._candidateSelection = null; 324 this._renderer.domElement.removeEventListener("mousemove", canvasMouseMove); 325 }; 326 327 this._renderer.domElement.addEventListener("mousemove", canvasMouseMove); 328 } 329 330 _canvasMouseUp(event) 331 { 332 if (!this._candidateSelection) 333 return; 334 335 let selection = this._candidateSelection.layerGroup; 320 336 if (selection && selection === this._selectedLayerGroup) { 321 337 if (!event.metaKey)
Note: See TracChangeset
for help on using the changeset viewer.