Skip to content

Commit 2cf6592

Browse files
committed
Remove 3d object spin timeout
- Removed timeout between stopping dragging object on menu and auto rotating to prevent few bugs
1 parent 68da4cd commit 2cf6592

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/components/menu/silly.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export default function Silly() {
8888
let isDragging = false;
8989
let previousX = 0;
9090
let previousY = 0;
91-
let rotateTimeout: NodeJS.Timeout | null = null;
9291

9392
const handleMouseDown = (e: MouseEvent) => {
9493
startDragging()
@@ -105,10 +104,6 @@ export default function Silly() {
105104
const startDragging = () => {
106105
isDragging = true;
107106
sceneManager.manuallyRotated = true;
108-
if (rotateTimeout) {
109-
clearTimeout(rotateTimeout)
110-
rotateTimeout = null
111-
}
112107
}
113108

114109
const handleMouseMove = (e: MouseEvent) => {
@@ -139,10 +134,7 @@ export default function Silly() {
139134

140135
const stopDragging = () => {
141136
isDragging = false;
142-
rotateTimeout = setTimeout(() => {
143-
sceneManager.manuallyRotated = false;
144-
rotateTimeout = null
145-
}, 2000);
137+
sceneManager.manuallyRotated = false;
146138
};
147139

148140
canvas.addEventListener('mousedown', handleMouseDown);

0 commit comments

Comments
 (0)