mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 22:37:11 +02:00
Fix error in floatingUIExample.js.
Script would crash if the user left clicked somewhere not on an overlay.
This commit is contained in:
parent
22453aa3ce
commit
a21fa94f14
1 changed files with 2 additions and 2 deletions
|
@ -170,10 +170,10 @@ function onMouseDown(event) {
|
||||||
function onMouseUp(event) {
|
function onMouseUp(event) {
|
||||||
if (event.isLeftButton) {
|
if (event.isLeftButton) {
|
||||||
var overlay = OverlayManager.findAtPoint({ x: event.x, y: event.y });
|
var overlay = OverlayManager.findAtPoint({ x: event.x, y: event.y });
|
||||||
if (overlay === mouseDown.overlay) {
|
if (overlay && overlay === mouseDown.overlay) {
|
||||||
if (overlay.attachedPanel === bluePanel) {
|
if (overlay.attachedPanel === bluePanel) {
|
||||||
overlay.destroy();
|
overlay.destroy();
|
||||||
} else if (overlay) {
|
} else {
|
||||||
var oldPos = overlay.offsetPosition;
|
var oldPos = overlay.offsetPosition;
|
||||||
var newPos = {
|
var newPos = {
|
||||||
x: Number(oldPos.x),
|
x: Number(oldPos.x),
|
||||||
|
|
Loading…
Reference in a new issue