Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 13 additions & 1 deletion Sources/Widgets/Widgets3D/PaintWidget/behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@ import macro from 'vtk.js/Sources/macros';
import { vec3 } from 'gl-matrix';

export default function widgetBehavior(publicAPI, model) {
// --------------------------------------------------------------------------
// Interactor events
// --------------------------------------------------------------------------

function ignoreKey(e) {
return e.altKey || e.controlKey || e.shiftKey;
}

publicAPI.handleLeftButtonPress = (callData) => {
if (!model.activeState || !model.activeState.getActive()) {
if (
!model.activeState ||
!model.activeState.getActive() ||
ignoreKey(callData)
) {
return macro.VOID;
}

Expand Down
11 changes: 10 additions & 1 deletion Sources/Widgets/Widgets3D/ShapeWidget/behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ export default function widgetBehavior(publicAPI, model) {
return model.hasFocus ? macro.EVENT_ABORT : macro.VOID;
};

// --------------------------------------------------------------------------
// Interactor events
// --------------------------------------------------------------------------

function ignoreKey(e) {
return e.altKey || e.controlKey || e.shiftKey;
}

// --------------------------------------------------------------------------
// Left click: Add point / End interaction
// --------------------------------------------------------------------------
Expand All @@ -514,7 +522,8 @@ export default function widgetBehavior(publicAPI, model) {
if (
!model.activeState ||
!model.activeState.getActive() ||
!model.pickable
!model.pickable ||
ignoreKey(e)
) {
return macro.VOID;
}
Expand Down
14 changes: 12 additions & 2 deletions Sources/Widgets/Widgets3D/SplineWidget/behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ export default function widgetBehavior(publicAPI, model) {
model.firstHandle = null;
};

// --------------------------------------------------------------------------
// Interactor events
// --------------------------------------------------------------------------

function ignoreKey(e) {
return e.altKey || e.controlKey || e.shiftKey;
}

// --------------------------------------------------------------------------
// Right click: Delete handle
// --------------------------------------------------------------------------
Expand All @@ -144,7 +152,8 @@ export default function widgetBehavior(publicAPI, model) {
if (
!model.activeState ||
!model.activeState.getActive() ||
!model.pickable
!model.pickable ||
ignoreKey(e)
) {
return macro.VOID;
}
Expand Down Expand Up @@ -179,7 +188,8 @@ export default function widgetBehavior(publicAPI, model) {
if (
!model.activeState ||
!model.activeState.getActive() ||
!model.pickable
!model.pickable ||
ignoreKey(e)
) {
return macro.VOID;
}
Expand Down