Появляние элементов

This commit is contained in:
2025-07-28 10:38:13 +03:00
parent d111cfd0f2
commit fed745b0e3

View File

@@ -54,13 +54,21 @@ export function getDefaultLayoutSettings(): FormLayoutSettings {
export function generateDefaultLayout(order: number): ElementLayout {
const baseX = 50
const baseY = 50
const spacing = 100
const elementWidth = 300
const elementHeight = 80
const horizontalSpacing = 320 // немного больше ширины элемента
const verticalSpacing = 100
const elementsPerRow = 3 // количество элементов в ряду
// Вычисляем позицию в сетке
const row = Math.floor(order / elementsPerRow)
const col = order % elementsPerRow
return {
x: baseX,
y: baseY + order * spacing,
width: 300,
height: 80,
x: baseX + col * horizontalSpacing,
y: baseY + row * verticalSpacing,
width: elementWidth,
height: elementHeight,
zIndex: 1,
}
}