ros viewer now hijakcs scroll and right click to prevent normal behaviour
parent
4b6a275696
commit
58eedd06a3
|
|
@ -11,6 +11,20 @@ export class ViewerOverlay {
|
||||||
|
|
||||||
|
|
||||||
this.overlayCanvas = document.getElementById('overlay-canvas');
|
this.overlayCanvas = document.getElementById('overlay-canvas');
|
||||||
|
this.overlayCanvas.addEventListener("wheel", (e) => {
|
||||||
|
e.preventDefault(); // stops page scroll/zoom
|
||||||
|
// your zoom logic here
|
||||||
|
}, { passive: false }); // passive:false is required to call preventDefault
|
||||||
|
// Disable browser context menu on canvas
|
||||||
|
this.overlayCanvas.addEventListener("contextmenu", (e) => {
|
||||||
|
e.preventDefault(); // stops the default right‑click menu
|
||||||
|
e.stopPropagation(); // keeps it from bubbling up
|
||||||
|
|
||||||
|
// Your custom right‑click logic here
|
||||||
|
// e.clientX / e.clientY give you the mouse position
|
||||||
|
//this.handleRightClick(e);
|
||||||
|
});
|
||||||
|
|
||||||
this.overlayCtx = this.overlayCanvas.getContext('2d');
|
this.overlayCtx = this.overlayCanvas.getContext('2d');
|
||||||
|
|
||||||
this.uiElements = []; // for motor list items if you wrap them in UIElements
|
this.uiElements = []; // for motor list items if you wrap them in UIElements
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue