+ [task#128767] calculate area row width for calculateCardPosition function.

This commit is contained in:
wangzemei
2024-09-24 17:35:50 +08:00
committed by 孙浩
parent a3ae21f342
commit 0a41335b50
+17
View File
@@ -100,6 +100,23 @@ function calculateCardPosition(region)
const d = 10; // 间距
const rows = flattenData(region.rows);
const rowsCount = rows.length;
let r = 0;
while (r < rowsCount)
{
let totalWidth = 0;
let validStartRow = -1;
for(let i = r; i < r + h && i < rowsCount; i++)
{
if(rows[i]?.right) totalWidth += rows[i].right - rows[i].left;
if(totalWidth >= minW)
{
validStartRow = r;
break;
}
}
}
}
/**