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

Function DrawBox

plot/plots/shapes.go:82–90  ·  view source on GitHub ↗
(pc *paint.Context, pos math32.Vector2, size float32)

Source from the content-addressed store, hash-verified

80}
81
82func DrawBox(pc *paint.Context, pos math32.Vector2, size float32) {
83 x := size * 0.9
84 pc.MoveTo(pos.X-x, pos.Y-x)
85 pc.LineTo(pos.X+x, pos.Y-x)
86 pc.LineTo(pos.X+x, pos.Y+x)
87 pc.LineTo(pos.X-x, pos.Y+x)
88 pc.ClosePath()
89 pc.FillStrokeClear()
90}
91
92func DrawTriangle(pc *paint.Context, pos math32.Vector2, size float32) {
93 x := size * 0.9

Callers 1

DrawShapeFunction · 0.85

Calls 4

MoveToMethod · 0.80
LineToMethod · 0.80
ClosePathMethod · 0.80
FillStrokeClearMethod · 0.80

Tested by

no test coverage detected