mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
[feat] Add viewport debug overlay for TransformPane
- Add optional red border overlay showing viewport bounds with 10px inset - Display viewport dimensions and device pixel ratio in overlay - Enable via "Show Performance Overlay" checkbox in debug panel - Helps visualize actual culling boundaries during development
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
v-if="transformPaneEnabled && canvasStore.canvas && comfyAppReady"
|
||||
:canvas="canvasStore.canvas as any"
|
||||
:viewport="canvasViewport"
|
||||
:show-debug-overlay="showPerformanceOverlay"
|
||||
@raf-status-change="rafActive = $event"
|
||||
@transform-update="handleTransformUpdate"
|
||||
>
|
||||
|
||||
@@ -7,6 +7,27 @@
|
||||
>
|
||||
<!-- Vue nodes will be rendered here -->
|
||||
<slot />
|
||||
|
||||
<!-- Debug: Viewport bounds visualization -->
|
||||
<div
|
||||
v-if="props.showDebugOverlay"
|
||||
class="viewport-debug-overlay"
|
||||
:style="{
|
||||
position: 'absolute',
|
||||
left: '10px',
|
||||
top: '10px',
|
||||
border: '2px solid red',
|
||||
width: (props.viewport?.width || 0) - 20 + 'px',
|
||||
height: (props.viewport?.height || 0) - 20 + 'px',
|
||||
pointerEvents: 'none',
|
||||
opacity: 0.5
|
||||
}"
|
||||
>
|
||||
<div style="position: absolute; top: 0; left: 0; background: red; color: white; padding: 2px 5px; font-size: 10px;">
|
||||
Viewport: {{ props.viewport?.width }}x{{ props.viewport?.height }}
|
||||
DPR: {{ devicePixelRatio }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -19,10 +40,14 @@ import { useTransformState } from '@/composables/element/useTransformState'
|
||||
interface TransformPaneProps {
|
||||
canvas?: LGraphCanvas
|
||||
viewport?: { width: number; height: number }
|
||||
showDebugOverlay?: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<TransformPaneProps>()
|
||||
|
||||
// Get device pixel ratio for display
|
||||
const devicePixelRatio = window.devicePixelRatio || 1
|
||||
|
||||
// Transform state management
|
||||
const {
|
||||
camera,
|
||||
|
||||
Reference in New Issue
Block a user