MCPcopy Create free account
hub / github.com/cogentcore/core / RectFromPosSizeMax

Function RectFromPosSizeMax

math32/vector2.go:159–163  ·  view source on GitHub ↗

RectFromPosSizeMax returns an [image.Rectangle] from the floor of pos and ceil of size.

(pos, size Vector2)

Source from the content-addressed store, hash-verified

157// RectFromPosSizeMax returns an [image.Rectangle] from the floor of pos
158// and ceil of size.
159func RectFromPosSizeMax(pos, size Vector2) image.Rectangle {
160 tp := pos.ToPointFloor()
161 ts := size.ToPointCeil()
162 return image.Rect(tp.X, tp.Y, tp.X+ts.X, tp.Y+ts.Y)
163}
164
165// RectFromPosSizeMax returns an [image.Rectangle] from the ceil of pos
166// and floor of size.

Callers 6

DrawBoxMethod · 0.92
BlurBoxMethod · 0.92
totalRectMethod · 0.92
contentRectMethod · 0.92
setBBoxesMethod · 0.92
TestVector2Function · 0.85

Calls 2

ToPointFloorMethod · 0.80
ToPointCeilMethod · 0.80

Tested by 1

TestVector2Function · 0.68