From 5a8e1c5acfa84c3bb95fe7ecf8a208853b1143d3 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 19 May 2020 15:21:27 +0200 Subject: [PATCH] layout: expand Constraints documentation Signed-off-by: Elias Naur --- layout/layout.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layout/layout.go b/layout/layout.go index 17c6cf72..6094a213 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -11,6 +11,13 @@ import ( ) // Constraints represent the minimum and maximum size of a widget. +// +// A widget does not have to treat its constraints as "hard". For +// example, if it's passed a constraint with a minimum size that's +// smaller than its actual minimum size, it should return its minimum +// size dimensions instead. Parent widgets should deal appropriately +// with child widgets that return dimensions that do not fit their +// constraints (for example, by clipping). type Constraints struct { Min, Max image.Point }