From c99ff181003c565385c21b92ca15161fbdff2bd8 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Tue, 24 Feb 2026 17:49:26 -0500 Subject: add layout constraints and abs/rel units --- len_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 len_test.go (limited to 'len_test.go') diff --git a/len_test.go b/len_test.go new file mode 100644 index 0000000..91b0886 --- /dev/null +++ b/len_test.go @@ -0,0 +1,16 @@ +package gui_test + +import ( + "fmt" + "image" + + "github.com/faiface/gui" +) + +func ExampleRelative() { + var l Length = Relative(0.10) // 10% + r := image.Rect(0, 0, 100, 100) // 100x100 rectangle + fmt.Println(l.Px(r)) + // Output: + // 10 +} -- cgit v1.2.3