@@ -69,6 +69,7 @@ function cleanup(instance: InteractionModifierModifier) {
69
69
canvas . removeEventListener ( 'pointercancel' , instance . onPointerCancel ) ;
70
70
canvas . removeEventListener ( 'pointermove' , instance . onPointerMove ) ;
71
71
canvas . removeEventListener ( 'pointerstop' , instance . onPointerStop ) ;
72
+ canvas . removeEventListener ( 'wheel' , instance . onWheel ) ;
72
73
document . removeEventListener ( 'keydown' , instance . keyDown ) ;
73
74
document . removeEventListener ( 'keyup' , instance . keyUp ) ;
74
75
}
@@ -138,6 +139,7 @@ export default class InteractionModifierModifier extends Modifier<InteractionMod
138
139
this . canvas . addEventListener ( 'pointerout' , this . onPointerOut ) ;
139
140
this . canvas . addEventListener ( 'pointercancel' , this . onPointerCancel ) ;
140
141
this . canvas . addEventListener ( 'pointermove' , this . onPointerMove ) ;
142
+ this . canvas . addEventListener ( 'wheel' , this . onWheel ) ;
141
143
142
144
document . addEventListener ( 'keydown' , this . keyDown ) ;
143
145
document . addEventListener ( 'keyup' , this . keyUp ) ;
@@ -243,6 +245,13 @@ export default class InteractionModifierModifier extends Modifier<InteractionMod
243
245
}
244
246
}
245
247
248
+ @action
249
+ onWheel ( event : WheelEvent ) {
250
+ if ( this . minimapService . isMouseInsideMinimap ( event ) ) {
251
+ this . minimapService . addZoomDelta ( - event . deltaY / 1000 ) ;
252
+ }
253
+ }
254
+
246
255
@action
247
256
onPointerStop ( customEvent : CustomEvent < MouseStopEvent > ) {
248
257
if ( this . pointers . length > 0 ) {
@@ -309,7 +318,7 @@ export default class InteractionModifierModifier extends Modifier<InteractionMod
309
318
) {
310
319
// check for click on Minimap
311
320
let intersectedViewObjectCopy = intersectedViewObj ;
312
- const isOnMinimap = this . minimapService . isClickInsideMinimap ( event ) ;
321
+ const isOnMinimap = this . minimapService . isMouseInsideMinimap ( event ) ;
313
322
const rayMarkers = this . minimapService . raycastForMarkers ( event ) ;
314
323
// if rayMarkers are present, it means that the click was on a marker
315
324
if ( rayMarkers ) {
@@ -378,7 +387,7 @@ export default class InteractionModifierModifier extends Modifier<InteractionMod
378
387
* @returns The object that was hit by the ray
379
388
*/
380
389
private handleMinimapDoubleClick ( event : MouseEvent ) {
381
- if ( this . minimapService . isClickInsideMinimap ( event ) ) {
390
+ if ( this . minimapService . isMouseInsideMinimap ( event ) ) {
382
391
return this . minimapService . raycastForObjects (
383
392
event ,
384
393
this . localUser . minimapCamera ,
0 commit comments