Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
/>
</TransformPane>

<!-- Selection rectangle overlay for Vue nodes mode -->
<SelectionRectangle v-if="shouldRenderVueNodes && comfyAppReady" />
<!-- Selection rectangle overlay - rendered in DOM layer to appear above DOM widgets -->
<SelectionRectangle v-if="comfyAppReady" />

Comment on lines +79 to 81
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Correct layering fix; consider scoping/clipping to canvas container.
Rendering the selection rectangle in the DOM layer (and not gating on shouldRenderVueNodes) matches the goal and should keep it above DOM widgets. One follow-up: ensure it can’t visually “spill” outside the canvas area (e.g., via an overflow-hidden positioned wrapper around the canvas + overlays) if that’s not desired.

🤖 Prompt for AI Agents
In src/components/graph/GraphCanvas.vue around lines 79-81, the
SelectionRectangle overlay is rendered in the DOM layer (correct) but may
visually spill outside the canvas; wrap the canvas and its overlays (including
SelectionRectangle) in a positioned container (e.g., position: relative) with
overflow: hidden so the rectangle is clipped to the canvas area, ensure overlays
are absolutely positioned within that wrapper, and keep existing comfyAppReady
gating; also verify pointer-events and z-index on the wrapper/overlays so
interaction and stacking remain correct.

<NodeTooltip v-if="tooltipEnabled" />
<NodeSearchboxPopover ref="nodeSearchboxPopoverRef" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/graph/SelectionRectangle.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
v-if="isVisible"
class="pointer-events-none absolute border border-blue-400 bg-blue-500/20"
class="pointer-events-none absolute z-9999 border border-blue-400 bg-blue-500/20"
:style="rectangleStyle"
/>
</template>
Expand Down
24 changes: 0 additions & 24 deletions src/lib/litegraph/src/LGraphCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4796,30 +4796,6 @@ export class LGraphCanvas implements CustomEventDispatcher<LGraphCanvasEventMap>
this.#renderSnapHighlight(ctx, highlightPos)
}

// Area-selection rectangle
// In Vue nodes mode, selection rectangle is rendered in DOM layer
if (this.dragging_rectangle && !LiteGraph.vueNodesMode) {
const { eDown, eMove } = this.pointer
ctx.strokeStyle = '#FFF'

if (eDown && eMove) {
// Do not scale the selection box
const transform = ctx.getTransform()
const ratio = Math.max(1, window.devicePixelRatio)
ctx.setTransform(ratio, 0, 0, ratio, 0, 0)

const x = eDown.safeOffsetX
const y = eDown.safeOffsetY
ctx.strokeRect(x, y, eMove.safeOffsetX - x, eMove.safeOffsetY - y)

ctx.setTransform(transform)
} else {
// Fallback to legacy behaviour
const [x, y, w, h] = this.dragging_rectangle
ctx.strokeRect(x, y, w, h)
}
}

// on top of link center
if (
!this.isDragging &&
Expand Down