Skip to content

Commit

Permalink
Merge branch 'main' into temp_notif_panel_appears
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlyn authored Nov 7, 2023
2 parents 1f95f28 + 567fa61 commit 5521599
Show file tree
Hide file tree
Showing 7 changed files with 947 additions and 783 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,16 @@ class CanvasContents extends React.Component {
} else if (CanvasUtils.isCmndCtrlPressed(evt) &&
!evt.shiftKey && evt.keyCode === Z_KEY && actions.undo) {
CanvasUtils.stopPropagationAndPreventDefault(evt);
this.props.canvasController.keyboardActionHandler("undo");
if (this.props.canvasController.canUndo()) {
this.props.canvasController.keyboardActionHandler("undo");
}

} else if (CanvasUtils.isCmndCtrlPressed(evt) &&
((evt.shiftKey && evt.keyCode === Z_KEY) || evt.keyCode === Y_KEY && actions.redo)) {
CanvasUtils.stopPropagationAndPreventDefault(evt);
this.props.canvasController.keyboardActionHandler("redo");
if (this.props.canvasController.canRedo()) {
this.props.canvasController.keyboardActionHandler("redo");
}

} else if (CanvasUtils.isCmndCtrlPressed(evt) && evt.keyCode === C_KEY && actions.copyToClipboard) {
CanvasUtils.stopPropagationAndPreventDefault(evt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,16 @@ export default class CanvasUtils {
}

// Returns an array of selected object IDs for nodes, comments and links
// that are within the region provided. Links are only included if
// that are within the region (inReg) provided. Links are only included if
// includeLinks is truthy.
static selectInRegion(region, pipeline, includeLinks, linkType, enableAssocLinkType) {
static selectInRegion(inReg, pipeline, includeLinks, linkType, enableAssocLinkType) {
const region = {
x1: inReg.x,
y1: inReg.y,
x2: inReg.x + inReg.width,
y2: inReg.y + inReg.height
};

var regionSelections = [];
for (const node of pipeline.nodes) {
if (!this.isSuperBindingNode(node) && // Don't include binding nodes in select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ export default class SVGCanvasD3 {
}

convertPageCoordsToSnappedCanvasCoords(pos) {
let positon = this.renderer.convertPageCoordsToCanvasCoords(pos.x, pos.y);
positon = this.renderer.getMousePosSnapToGrid(positon);
return positon;
return this.renderer.convertPageCoordsToSnappedCanvasCoords(pos);
}

nodeTemplateDragStart(nodeTemplate) {
Expand Down
Loading

0 comments on commit 5521599

Please sign in to comment.