Skip to content

Commit 248fd65

Browse files
author
Julien Poulton
committed
Merge branch 'listen-to-mousewheel' into 'master'
[FIX](SDK) update render on mousewheel See merge request codingame/game-engine!224
2 parents 5516258 + 050bf13 commit 248fd65

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

engine/core/src/main/resources/view/core/Drawer.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,13 +738,18 @@ export class Drawer {
738738
var key
739739
window.PIXI = Drawer.PIXI || window.PIXI
740740
this.oversampling = oversampling || 1
741-
this.canvas = $(canvas)
742-
this.canvas.off('mousemove')
743-
this.canvas.mousemove(() => {
741+
742+
const notifyRenderer = () => {
744743
if (this.currentFrame >= 0) {
745744
this.changed = true
746745
}
747-
})
746+
}
747+
748+
this.canvas = $(canvas)
749+
this.canvas.off('mousemove')
750+
this.canvas.off('wheel')
751+
this.canvas.bind('wheel', notifyRenderer)
752+
this.canvas.mousemove(notifyRenderer)
748753

749754
if (colors) this.colors = this.parseColor(colors)
750755

playground/misc/misc-3-release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The CodinGame SDK is regularly updated and improved. This document lets you know
77
### 🐞 Bug fix
88

99
- Fixed Tooltip not showing all texts of stacked sprites below the cursor
10+
- Fixed viewer not updating on mouse wheel event
1011

1112
## 3.4.9
1213

0 commit comments

Comments
 (0)