aboutsummaryrefslogtreecommitdiffstats
path: root/len_test.go
blob: 91b0886c9e4c414ffba4dc8969f6dbab126e31fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}