don't re-calculate values in loops for layouts

This commit is contained in:
Drew Weymouth
2023-05-03 09:09:13 -07:00
parent fd01e37260
commit e486fcddad
5 changed files with 16 additions and 10 deletions
+3 -2
View File
@@ -25,8 +25,9 @@ func (c *ColumnsLayout) MinSize(objects []fyne.CanvasObject) fyne.Size {
if !objects[i].Visible() {
continue
}
height = fyne.Max(height, objects[i].MinSize().Height)
w := objects[i].MinSize().Width
s := objects[i].MinSize()
height = fyne.Max(height, s.Height)
w := s.Width
if i < len(c.ColumnWidths) && c.ColumnWidths[i] > w {
w = c.ColumnWidths[i]
}