-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlength.go
More file actions
37 lines (32 loc) · 777 Bytes
/
length.go
File metadata and controls
37 lines (32 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package goey
import (
"bitbucket.org/rj/goey/base"
)
// Common lengths used when describing GUIs.
// Note that the DIP (device-independent pixel) is the natural unit for this
// package. Because of limited precision, the PT listed here is somewhat smaller
// than its correct value.
const (
DIP = base.DIP // Device-independent pixel (1/96 inch)
PT = base.PT // Point (1/72 inch)
PC = base.PC // Pica (1/6 inch or 12 points)
Inch = base.Inch // Inch from a British imperial system of measurements
)
func guardInf(a, b base.Length) base.Length {
if a == base.Inf {
return base.Inf
}
return b
}
func max(a, b base.Length) base.Length {
if a > b {
return a
}
return b
}
func min(a, b base.Length) base.Length {
if a < b {
return a
}
return b
}