github.com/as/shiny@v0.8.2/driver/win32/rect.go (about) 1 package win32 2 3 type Rectangle struct { 4 Min, Max Point 5 } 6 7 func (r Rectangle) Dx() int32 { 8 return r.Max.X - r.Min.X 9 } 10 func (r Rectangle) Dy() int32 { 11 return r.Max.Y - r.Min.Y 12 } 13 14 func Rect(x, y, xx, yy int) Rectangle { 15 return Rectangle{ 16 Min: Point{ 17 int32(x), 18 int32(y), 19 }, 20 Max: Point{ 21 int32(xx), 22 int32(yy), 23 }, 24 } 25 }