v0.0.497
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Failing after 2m33s

This commit is contained in:
2024-08-07 17:04:59 +02:00
parent 741611a2e1
commit 7204562879
2 changed files with 15 additions and 10 deletions

View File

@@ -289,23 +289,28 @@ func (b *TableBuilder) calculateColumns() []float64 {
return columnWidths
}
for i, _ := range columnDef {
if frColumnWeights[i] != 0 {
w := min(autoWidths[i], (remainingWidth/float64(frColumnWidthCount))*frColumnWeights[i])
remainingWidth += columnWidths[i]
columnWidths[i] = w
remainingWidth -= w
{
rmSub := 0.0
for i := range columnDef {
if frColumnWeights[i] != 0 {
w := min(autoWidths[i], (remainingWidth/float64(frColumnWidthCount))*frColumnWeights[i])
rmSub += w - columnWidths[i]
columnWidths[i] = w
}
}
remainingWidth -= rmSub
}
if remainingWidth > 0 {
if remainingWidth > 0.01 {
rmSub := 0.0
for i, _ := range columnDef {
if frColumnWeights[i] != 0 {
addW := (remainingWidth / float64(frColumnWidthCount)) * frColumnWeights[i]
rmSub += addW
columnWidths[i] += addW
remainingWidth -= addW
}
}
remainingWidth -= rmSub
}
return columnWidths