LCOV - code coverage report
Current view: top level - src/composables/canvas - visibleCanvasViewport.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 4 4
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import type { ReadOnlyRect } from '@comfyorg/shared-frontend-utils/geometry'
       2              : import type { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
       3              : import { useAgentPanelStore } from '@/workbench/extensions/agent/stores/agent/agentPanelStore'
       4              : 
       5          203 : export function visibleCanvasViewport(
       6              :   canvas: Pick<LGraphCanvas, 'ds'>
       7              : ): ReadOnlyRect {
       8          203 :   const panel = useAgentPanelStore()
       9          203 :   const [width, height] = canvas.ds.getViewportSize()
      10              :   const coveredWidth = panel.isVisible ? panel.width : 0
      11              :   const uncoveredWidth = width - coveredWidth
      12          203 :   return [0, 0, uncoveredWidth > 0 ? uncoveredWidth : width, height]
      13              : }
        

Generated by: LCOV version 2.0-1