Skip to content

Commit e419afa

Browse files
committed
stop throttling window resize and scrolling for a smoother experience
1 parent d2e2f3f commit e419afa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/melonjs/src/video/video.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { initialized, game } from "./../index.js";
22
import * as device from "./../system/device.js";
3-
import { throttle } from "../utils/function.ts";
43
import {
54
eventEmitter,
65
VIDEO_INIT,
@@ -77,9 +76,9 @@ export function init(width, height, options) {
7776
//add a channel for the onresize/onorientationchange event
7877
globalThis.addEventListener(
7978
"resize",
80-
throttle((e) => {
79+
(e) => {
8180
eventEmitter.emit(WINDOW_ONRESIZE, e);
82-
}, 100),
81+
},
8382
false,
8483
);
8584

@@ -110,9 +109,9 @@ export function init(width, height, options) {
110109
// Automatically update relative canvas position on scroll
111110
globalThis.addEventListener(
112111
"scroll",
113-
throttle((e) => {
112+
(e) => {
114113
eventEmitter.emit(WINDOW_ONSCROLL, e);
115-
}, 100),
114+
},
116115
false,
117116
);
118117

0 commit comments

Comments
 (0)