mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
more fixes to pointer.js
This commit is contained in:
parent
042713d1ec
commit
aeb5cead65
1 changed files with 2 additions and 5 deletions
|
@ -17,7 +17,6 @@ function removeLine() {
|
||||||
Entities.deleteEntity(lineEntityID);
|
Entities.deleteEntity(lineEntityID);
|
||||||
lineEntityID = null;
|
lineEntityID = null;
|
||||||
lineIsRezzed = false;
|
lineIsRezzed = false;
|
||||||
Controller.mouseMoveEvent.disconnect(mouseMoveEvent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ function createOrUpdateLine(event) {
|
||||||
color: { red: 255, green: 255, blue: 255 },
|
color: { red: 255, green: 255, blue: 255 },
|
||||||
lifetime: 60 // if someone crashes while pointing, don't leave the line there forever.
|
lifetime: 60 // if someone crashes while pointing, don't leave the line there forever.
|
||||||
});
|
});
|
||||||
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
removeLine();
|
removeLine();
|
||||||
|
@ -56,9 +54,7 @@ function mousePressEvent(event) {
|
||||||
if (!event.isLeftButton) {
|
if (!event.isLeftButton) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lineIsRezzed) {
|
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
||||||
return;
|
|
||||||
}
|
|
||||||
createOrUpdateLine(event);
|
createOrUpdateLine(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +65,7 @@ function mouseMoveEvent(event) {
|
||||||
|
|
||||||
|
|
||||||
function mouseReleaseEvent() {
|
function mouseReleaseEvent() {
|
||||||
|
Controller.mouseMoveEvent.disconnect(mouseMoveEvent);
|
||||||
removeLine();
|
removeLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue