Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cadquery/cq_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@
document.addEventListener('scroll', recomputeViewports);


// listens on the body but reports the canvas size, which vtk.js uses to convert mouse positions
const eventContainer = {
addEventListener: (...args) => document.body.addEventListener(...args),
removeEventListener: (...args) => document.body.removeEventListener(...args),
getBoundingClientRect: () => openglRenderWindow.getCanvas().getBoundingClientRect(),
};

function enterCurrentRenderer(e) {
interactor.bindEvents(document.body);
interactor.bindEvents(eventContainer);
interact_style.setEnabled(true);
interactor.setCurrentRenderer(RENDERERS[e.target.id]);
}
Expand Down
Loading