|
|
|
@ -41,12 +41,12 @@ func (row Row) MinimumSize (hints tomo.LayoutHints, boxes []tomo.Box) image.Poin
|
|
|
|
|
|
|
|
|
|
|
|
func (column Column) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
func (column Column) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
expands := func (index int) bool {
|
|
|
|
expands := func (index int) bool {
|
|
|
|
if index < len(boxes) { return false }
|
|
|
|
if index >= len(column) { return false }
|
|
|
|
return column[index]
|
|
|
|
return column[index]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// determine expanding box size
|
|
|
|
// determine expanding box size
|
|
|
|
expandingSize := 0
|
|
|
|
expandingSize := 0.0
|
|
|
|
if !hints.OverflowY {
|
|
|
|
if !hints.OverflowY {
|
|
|
|
gaps := len(boxes) - 1
|
|
|
|
gaps := len(boxes) - 1
|
|
|
|
freeSpace := float64(hints.Bounds.Dy() - hints.Gap.Y * gaps)
|
|
|
|
freeSpace := float64(hints.Bounds.Dy() - hints.Gap.Y * gaps)
|
|
|
|
@ -83,7 +83,7 @@ func (column Column) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if expands(index) {
|
|
|
|
if expands(index) {
|
|
|
|
height = expandingSize
|
|
|
|
height = int(expandingSize)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -111,12 +111,12 @@ func (column Column) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
|
|
|
|
|
|
|
|
func (row Row) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
func (row Row) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) {
|
|
|
|
expands := func (index int) bool {
|
|
|
|
expands := func (index int) bool {
|
|
|
|
if index < len(boxes) { return false }
|
|
|
|
if index >= len(row) { return false }
|
|
|
|
return row[index]
|
|
|
|
return row[index]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// determine expanding box size
|
|
|
|
// determine expanding box size
|
|
|
|
expandingSize := 0
|
|
|
|
expandingSize := 0.0
|
|
|
|
if !hints.OverflowY {
|
|
|
|
if !hints.OverflowY {
|
|
|
|
gaps := len(boxes) - 1
|
|
|
|
gaps := len(boxes) - 1
|
|
|
|
freeSpace := float64(hints.Bounds.Dx() - hints.Gap.X * gaps)
|
|
|
|
freeSpace := float64(hints.Bounds.Dx() - hints.Gap.X * gaps)
|
|
|