camera bug fix
This commit is contained in:
@@ -120,14 +120,14 @@ export default function Controls() {
|
||||
const controls = controlsRef.current;
|
||||
if (controls && !toggleView && camType === "perspective") {
|
||||
controls.addEventListener("sleep", handleRest);
|
||||
controls.addEventListener("update", startInterval);
|
||||
controls.addEventListener("control", startInterval);
|
||||
controls.addEventListener("controlend", stopInterval);
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (controls) {
|
||||
controls.removeEventListener("sleep", handleRest);
|
||||
controls.removeEventListener("update", startInterval);
|
||||
controls.removeEventListener("control", startInterval);
|
||||
controls.removeEventListener("controlend", stopInterval);
|
||||
}
|
||||
stopInterval();
|
||||
|
||||
Reference in New Issue
Block a user