fix(canvas): include component-set members in label catalog

This commit is contained in:
Danila Poyarkov 2026-09-16 14:13:34 +03:00
parent ba519c04c0
commit 5b151ffc1e
3 changed files with 6 additions and 1 deletions

View file

@ -25,7 +25,7 @@ interface Viewport {
}
const LABEL_TYPES = new Set(['COMPONENT', 'COMPONENT_SET'])
const COMPONENT_LABEL_PARENT_TYPES = new Set(['CANVAS', 'SECTION'])
const COMPONENT_LABEL_PARENT_TYPES = new Set(['CANVAS', 'SECTION', 'COMPONENT_SET'])
function isInViewport(absX: number, absY: number, w: number, h: number, vp: Viewport): boolean {
return absX + w >= vp.x && absY + h >= vp.y && absX <= vp.x + vp.w && absY <= vp.y + vp.h

View file

@ -62,6 +62,11 @@ test('component labels in component sets are hit-tested above the component boun
const componentTopY = 80 + (100 + 40) * 2
const componentLeftX = 80 + (100 + 20) * 2
await expect(page).toHaveScreenshot('component-set-member-label.png', {
clip: { x: box.x + componentLeftX, y: box.y + componentTopY - 24, width: 240, height: 24 },
maxDiffPixels: 0,
threshold: 0
})
await page.mouse.click(box.x + componentLeftX + 24, box.y + componentTopY - 12)
await canvas.waitForRender()

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B