three-render-objects
Advanced tools
Comparing version 1.24.2 to 1.24.3
@@ -492,20 +492,14 @@ 'use strict'; | ||
if (ev.button === 0) { | ||
// left-click | ||
setTimeout(function () { | ||
return (// asynchronously to allow hoverObj to be set (on frame) | ||
state.onClick(state.hoverObj || null, ev, state.intersectionPoint) | ||
); | ||
} // trigger background clicks with null | ||
); | ||
} | ||
requestAnimationFrame(function () { | ||
// trigger click events asynchronously, to allow hoverObj to be set (on frame) | ||
if (ev.button === 0) { | ||
// left-click | ||
state.onClick(state.hoverObj || null, ev, state.intersectionPoint); // trigger background clicks with null | ||
} | ||
if (ev.button === 2 && state.onRightClick) { | ||
// right-click | ||
setTimeout(function () { | ||
return (// asynchronously to allow hoverObj to be set (on frame) | ||
state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint) | ||
); | ||
}); | ||
} | ||
if (ev.button === 2 && state.onRightClick) { | ||
// right-click | ||
state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint); | ||
} | ||
}); | ||
}, true); // use capture phase to prevent propagation blocking from controls (specifically for fly) | ||
@@ -512,0 +506,0 @@ |
@@ -488,20 +488,14 @@ import { WebGLRenderer, Scene, PerspectiveCamera, Raycaster, TextureLoader, Vector2, Vector3, Box3, Color, Mesh, SphereGeometry, MeshBasicMaterial, BackSide, EventDispatcher, MOUSE, Quaternion, Spherical, Clock } from 'three'; | ||
if (ev.button === 0) { | ||
// left-click | ||
setTimeout(function () { | ||
return (// asynchronously to allow hoverObj to be set (on frame) | ||
state.onClick(state.hoverObj || null, ev, state.intersectionPoint) | ||
); | ||
} // trigger background clicks with null | ||
); | ||
} | ||
requestAnimationFrame(function () { | ||
// trigger click events asynchronously, to allow hoverObj to be set (on frame) | ||
if (ev.button === 0) { | ||
// left-click | ||
state.onClick(state.hoverObj || null, ev, state.intersectionPoint); // trigger background clicks with null | ||
} | ||
if (ev.button === 2 && state.onRightClick) { | ||
// right-click | ||
setTimeout(function () { | ||
return (// asynchronously to allow hoverObj to be set (on frame) | ||
state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint) | ||
); | ||
}); | ||
} | ||
if (ev.button === 2 && state.onRightClick) { | ||
// right-click | ||
state.onRightClick(state.hoverObj || null, ev, state.intersectionPoint); | ||
} | ||
}); | ||
}, true); // use capture phase to prevent propagation blocking from controls (specifically for fly) | ||
@@ -508,0 +502,0 @@ |
{ | ||
"name": "three-render-objects", | ||
"version": "1.24.2", | ||
"version": "1.24.3", | ||
"description": "Easy way to render ThreeJS objects with built-in interaction defaults", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5147686
37570