yaustar / yaustar.github.io

41 stars 3 forks source link

Prevent input events on PCUI to affect e.g. Orbit Camera #17

Closed kungfooman closed 3 years ago

kungfooman commented 3 years ago

The PCUI container just needs this code, so that e.g. scrolling down the Graph Inspector doesn't zoom out Orbit Camera:

function stopPropagatingInputEvents(element) {
  element.onkeydown = function(event) {
    event.stopPropagation();
  };
  element.onmousedown = function(event) {
    event.stopPropagation();
  };
  element.onmousemove = function(event) {
    event.stopPropagation();
  };
  element.onmousewheel = function(event) {
    event.stopPropagation();
  };
}

stopPropagatingInputEvents(pcGraphInspector.container.dom);
yaustar commented 3 years ago

Fixed as part of https://github.com/yaustar/yaustar.github.io/pull/18