Skip to content

Commit

Permalink
Don't select entity on raycaster click if we moved the mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Jul 16, 2024
1 parent b792e91 commit c44e894
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 c44e894

Please sign in to comment.