ContainerBox correctly checks for overflow when reporting recommended size
This commit is contained in:
parent
33969f45e9
commit
6ff5dea308
@ -187,7 +187,7 @@ func (this *containerBox) setAttr (attr tomo.Attr, user bool) {
|
|||||||
|
|
||||||
func (this *containerBox) recommendedHeight (width int) int {
|
func (this *containerBox) recommendedHeight (width int) int {
|
||||||
layout := this.attrLayout.Value().Layout
|
layout := this.attrLayout.Value().Layout
|
||||||
if layout == nil || this.attrOverflow.Value().Y {
|
if layout == nil || !this.attrOverflow.Value().Y {
|
||||||
return this.minSize.Value().Y
|
return this.minSize.Value().Y
|
||||||
} else {
|
} else {
|
||||||
return layout.RecommendedHeight(this.layoutHints(), this.boxQuerier(), width) +
|
return layout.RecommendedHeight(this.layoutHints(), this.boxQuerier(), width) +
|
||||||
@ -197,7 +197,7 @@ func (this *containerBox) recommendedHeight (width int) int {
|
|||||||
|
|
||||||
func (this *containerBox) recommendedWidth (height int) int {
|
func (this *containerBox) recommendedWidth (height int) int {
|
||||||
layout := this.attrLayout.Value().Layout
|
layout := this.attrLayout.Value().Layout
|
||||||
if layout == nil || this.attrOverflow.Value().X {
|
if layout == nil || !this.attrOverflow.Value().X {
|
||||||
return this.minSize.Value().X
|
return this.minSize.Value().X
|
||||||
} else {
|
} else {
|
||||||
return layout.RecommendedWidth(this.layoutHints(), this.boxQuerier(), height) +
|
return layout.RecommendedWidth(this.layoutHints(), this.boxQuerier(), height) +
|
||||||
|
Loading…
Reference in New Issue
Block a user