Skip to content

Commit

Permalink
allow for padding when drag selecting
Browse files Browse the repository at this point in the history
closes #481
  • Loading branch information
Brendonovich committed Aug 24, 2024
1 parent b4fc1f2 commit 6da190f
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 226 deletions.
9 changes: 7 additions & 2 deletions interface/src/components/Graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
toScreenSpace,
} from "./Context";
import { Node } from "./Node";
import { GRID_SIZE } from "./util";

type PanState = "none" | "waiting" | "active";

Expand Down Expand Up @@ -350,14 +351,18 @@ export const Graph = (props: Props) => {

const items = [
...[
...getNodesInRect(model().nodes.values(), rect, (node) =>
interfaceCtx.nodeSizes.get(node),
...getNodesInRect(
model().nodes.values(),
rect,
(node) => interfaceCtx.nodeSizes.get(node),
GRID_SIZE * 2,
),
].map((n) => ({ id: n.id, type: "node" as const })),
...[
...getCommentBoxesInRect(
model().commentBoxes.values(),
rect,
GRID_SIZE * 2,
),
].map((b) => ({
id: b.id,
Expand Down
Loading

0 comments on commit 6da190f

Please sign in to comment.