Skip to content

Commit

Permalink
#1615 Refactor zoom code into a utility file (for consistency) (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlyn authored Nov 6, 2023
1 parent a9c8972 commit ea3123e
Show file tree
Hide file tree
Showing 5 changed files with 939 additions and 766 deletions.
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 ea3123e

Please sign in to comment.