Skip to content

Commit 2e61a9d

Browse files
committed
Edited debounce and cursor size
1 parent b783a9b commit 2e61a9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/components/main/Canvas.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ function Canvas(props: {}): JSX.Element {
3939
setToggleText(toggleText === 'on' ? 'off' : 'on');
4040
};
4141

42-
// Prevents lagging and provides smoother user experience got live cursor tracking (milliseconds can be adjusted but 300ms is most optimal)
42+
// Prevents lagging and provides smoother user experience got live cursor tracking (milliseconds can be adjusted but 500ms is most optimal)
4343
const debounceSetPosition = debounce((newX, newY) => {
4444
//emit socket event every 300ms when cursor moves
4545
if (userList.length > 1)
4646
emitEvent('cursorData', roomCode, { x: newX, y: newY, userName });
47-
}, 300);
47+
}, 500);
4848

4949
const handleMouseMove = (e) => {
5050
debounceSetPosition(e.clientX, e.clientY);
@@ -355,7 +355,7 @@ function Canvas(props: {}): JSX.Element {
355355
left: cursor.x + 'px',
356356
top: cursor.y - 68 + 'px',
357357
//cursor style
358-
fontSize: '2em',
358+
fontSize: '1em',
359359
color: userColors[userList.indexOf(cursor.remoteUserName)]
360360
}}
361361
>

0 commit comments

Comments
 (0)