From 22bdc1ae840c56fc4adb0762376a3ef1654fbf42 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Mon, 7 Dec 2015 13:49:49 +0100 Subject: [PATCH] Make it possible to use the focus-right-click-drag-camera in the edit.js script again. Still keep right-clicking ignore Toolbar and entity selection events. --- examples/edit.js | 9 +++++---- examples/libraries/entitySelectionTool.js | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index 9b83079198..5d5d642f47 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -392,6 +392,11 @@ var toolBar = (function() { url, file; + if (!event.isLeftButton) { + // if another mouse button than left is pressed ignore it + return false; + } + clickedOverlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y @@ -738,10 +743,6 @@ var mousePressStartPosition = { var mouseDown = false; function mousePressEvent(event) { - if (!event.isLeftButton) { - // If another mouse button than left is pressed ignore it - return false; - } mouseDown = true; mousePressStartPosition = { x: event.x, diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 61aa5b0394..6edbe6844b 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -2340,6 +2340,11 @@ SelectionDisplay = (function () { that.mousePressEvent = function(event) { + if (!event.isLeftButton) { + // if another mouse button than left is pressed ignore it + return false; + } + var somethingClicked = false; var pickRay = Camera.computePickRay(event.x, event.y);