Skip to content

Commit

Permalink
Don't select entity on raycaster click if we moved the mouse (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin authored Jul 22, 2024
1 parent 519b74d commit e742ab6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lib/raycaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ export function initRaycaster(inspector) {

function handleClick(evt) {
// Check to make sure not dragging.
const DRAG_THRESHOLD = 0.03;
if (onDownPosition.distanceTo(onUpPosition) >= DRAG_THRESHOLD) {
return;
if (onDownPosition.distanceTo(onUpPosition) === 0) {
inspector.selectEntity(evt.detail.intersectedEl);
}
inspector.selectEntity(evt.detail.intersectedEl);
}

function onMouseDown(event) {
Expand Down

0 comments on commit e742ab6

Please sign in to comment.