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:
@ -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
|
||||
|
Reference in New Issue
Block a user