fix
This commit is contained in:
parent
2261a0d0fc
commit
70cbe99302
1 changed files with 8 additions and 1 deletions
|
|
@ -787,7 +787,7 @@ func (gd *gridDiagram) fastLayout(targetSize float64, nCuts int, columns bool) (
|
|||
}
|
||||
if rowSize == 0 {
|
||||
if size > targetSize-debt {
|
||||
fastDivision = append(fastDivision, i-1)
|
||||
fastDivision = append(fastDivision, i)
|
||||
// we build up a debt of distance past the target size across rows
|
||||
newDebt := size - targetSize
|
||||
debt += newDebt
|
||||
|
|
@ -916,6 +916,13 @@ func getDistToTarget(layout [][]*d2graph.Object, targetSize float64, horizontalG
|
|||
rowSize += o.Width + horizontalGap
|
||||
}
|
||||
}
|
||||
if len(row) > 0 {
|
||||
if columns {
|
||||
rowSize -= verticalGap
|
||||
} else {
|
||||
rowSize -= horizontalGap
|
||||
}
|
||||
}
|
||||
totalDelta += math.Abs(rowSize - targetSize)
|
||||
}
|
||||
return totalDelta
|
||||
|
|
|
|||
Loading…
Reference in a new issue