formatting

This commit is contained in:
Guilhem
2026-03-04 14:36:33 +00:00
parent 7a2c0a452b
commit 038bc6783d
2 changed files with 17 additions and 11 deletions
@@ -361,8 +361,7 @@
})
// Center horizontally
const xCenter =
(fullSize ? fullWidth : width) / 2 - bbox.width / 2 - (width - fullWidth) / 2
const xCenter = (fullSize ? fullWidth : width) / 2 - bbox.width / 2 - (width - fullWidth) / 2
const newNodes = nodes.map((n) => ({
id: n.id,
position: {
@@ -926,7 +925,12 @@
<SvelteFlowProvider>
<ViewportResizer {height} {width} {nodes} bind:this={viewportResizer} />
{#if moveManager}
<DragCoordinator {moveManager} eventHandlers={eventHandler} {edges} nodes={nodesWithOffset} />
<DragCoordinator
{moveManager}
eventHandlers={eventHandler}
{edges}
nodes={nodesWithOffset}
/>
{/if}
{#if sharedViewport && onViewportChange}
<ViewportSynchronizer
@@ -990,8 +994,8 @@
{#if multiSelectEnabled}
<SelectionBoundingBox
selectedNodes={selectionManager.selectedIds.filter(id =>
nodesWithOffset.some(n => n.id === id)
selectedNodes={selectionManager.selectedIds.filter((id) =>
nodesWithOffset.some((n) => n.id === id)
)}
allNodes={nodesWithOffset as (Node & { type: string })[]}
onDeleteSelected={() => onDeleteMultiple?.(resolvedModuleIds)}
@@ -1012,7 +1016,12 @@
{@render leftHeader()}
</div>
{:else}
<Controls position="top-right" orientation="horizontal" showLock={false} fitViewOptions={{ nodes: nodes.filter((n) => n.type !== 'note') }}>
<Controls
position="top-right"
orientation="horizontal"
showLock={false}
fitViewOptions={{ nodes: nodes.filter((n) => n.type !== 'note') }}
>
{#if multiSelectEnabled}
<div class="flex items-center gap-2">
<Tooltip>
@@ -341,12 +341,9 @@ function layoutLevel(
if (isBranch) {
// Place branches side by side horizontally
branchWidths = branchLayouts.map((bl) =>
Math.max(bl.bbox.width, constants.nodeWidth)
)
branchWidths = branchLayouts.map((bl) => Math.max(bl.bbox.width, constants.nodeWidth))
const gaps = Math.max(0, branchWidths.length - 1) * constants.gapH
totalWidth =
branchWidths.reduce((s, w) => s + w, 0) + gaps
totalWidth = branchWidths.reduce((s, w) => s + w, 0) + gaps
wrapperWidth = Math.max(totalWidth, constants.nodeWidth)
maxBranchHeight = Math.max(0, ...branchLayouts.map((bl) => bl.bbox.height))