1
0
forked from gee/bd-chapril

Zoom on wheel functionality fixed

This commit is contained in:
Frédéric Henry 2025-01-03 00:11:53 +01:00
parent ff7a0263c2
commit cfb38ea271
Signed by: fhenry2
GPG Key ID: D752390BFF432D86

View File

@ -60,13 +60,14 @@ $(d).on('keydown', function(event){
}
});
d.onmousewheel = function(mw){
if(currentObj && mw.wheelDelta > 0){
d.addEventListener('wheel', function(event) {
event.preventDefault();
if(currentObj && event.deltaY > 0){
cg.zoomIn(currentObj);
} else if (currentObj && mw.wheelDelta < 0){
} else if (currentObj && event.deltaY < 0){
cg.zoomOut(currentObj);
}
};
}, { passive: false });
cg.hoverdiv = function(e,divid){
var x = e.clientX + 25;