mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 17:58:55 +00:00
Fixes WASD of camera. (#491)
Patch until we implement Scene API for mouse events.
This commit is contained in:
1 parent
d6a937d33f
commit
271f3abcd1
1 file changed
+3
-3
@@ -485,12 +485,12 @@ class Editor {
|
||||
|
||||
this.timeline.scene = this.activeScene;
|
||||
|
||||
this.renderer.domElement.addEventListener(
|
||||
window.addEventListener(
|
||||
"mousedown",
|
||||
this.mouse_controls.onMouseDown.bind(this.mouse_controls),
|
||||
false,
|
||||
);
|
||||
this.renderer.domElement.addEventListener(
|
||||
window.addEventListener(
|
||||
"mouseup",
|
||||
this.mouse_controls.onMouseUp.bind(this.mouse_controls),
|
||||
false,
|
||||
@@ -520,7 +520,7 @@ class Editor {
|
||||
|
||||
document.addEventListener("mouseover", (event) => {
|
||||
if (this.orbitControls && this.cameraViewControls) {
|
||||
if (event.target instanceof HTMLCanvasElement) {
|
||||
if (event.target instanceof HTMLCanvasElement || (event.target as HTMLElement).id == "letterbox") {
|
||||
if (this.camera_person_mode) {
|
||||
this.orbitControls.enabled = false;
|
||||
this.cameraViewControls.enabled = true;
|
||||
|
||||
Reference in new issue
Block a user