Skip to content

Commit

Permalink
Merge pull request #238 from kipr/no-deselect-on-drag
Browse files Browse the repository at this point in the history
Don't select/deselect items when dragging the mouse
  • Loading branch information
bmcdorman authored Aug 3, 2021
2 parents eac2de9 + 0ea1f5b commit 27c4f74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simulator",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.js",
"author": "KISS Institute for Practical Robotics",
"license": "GPL-3.0-only",
Expand Down
8 changes: 4 additions & 4 deletions src/Sim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ export class Space {
this.scene.attachControl();
}

private onPointerDown_ = (event: PointerEvent, pickResult: Babylon.PickingInfo, type: Babylon.PointerEventTypes) => {
if (!pickResult.hit) {
private onPointerTap_ = (eventData: Babylon.PointerInfo, eventState: Babylon.EventState) => {
if (!eventData.pickInfo.hit) {
store.dispatch(SceneAction.UNSELECT_ALL);
return;
}


const mesh = pickResult.pickedMesh;
const mesh = eventData.pickInfo.pickedMesh;
const meshName = mesh.id || mesh.name;

for (const [itemId, itemMeshName] of this.itemMap_) {
Expand All @@ -338,7 +338,7 @@ export class Space {
};

private createScene(): void {
this.scene.onPointerDown = this.onPointerDown_;
this.scene.onPointerObservable.add(this.onPointerTap_, Babylon.PointerEventTypes.POINTERTAP);

this.camera.setTarget(Babylon.Vector3.Zero());
this.camera.attachControl(this.workingCanvas, true);
Expand Down

0 comments on commit 27c4f74

Please sign in to comment.