mouse listners should be reset outside of sketch (#1442)

* mouse listners should be reset outside of sketch (only orbit controls are needed) and also check mouse button

* tweak
This commit is contained in:
Kurt Hutten
2024-02-19 12:41:36 +11:00
committed by GitHub
parent 3377923dcb
commit 4d77875bdc
4 changed files with 22 additions and 3 deletions

View File

@ -332,6 +332,7 @@ class SceneEntities {
if (!draftSegment) {
sceneInfra.setCallbacks({
onDrag: (args) => {
if (args.event.which !== 1) return
this.onDragSegment({
...args,
sketchPathToNode,
@ -339,6 +340,7 @@ class SceneEntities {
},
onMove: () => {},
onClick: (args) => {
if (args?.event.which !== 1) return
if (!args || !args.object) {
sceneInfra.modelingSend({
type: 'Set selection',
@ -396,6 +398,7 @@ class SceneEntities {
onDrag: () => {},
onClick: async (args) => {
if (!args) return
if (args.event.which !== 1) return
const { intersection2d } = args
if (!intersection2d) return
@ -792,6 +795,7 @@ class SceneEntities {
},
onClick: (args) => {
if (!args || !args.object) return
if (args.event.which !== 1) return
const { object, intersection } = args
const type = object?.userData?.type || ''
const posNorm = Number(intersection.normal?.z) > 0