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

Function DrawShape

plot/plots/shapes.go:41–60  ·  view source on GitHub ↗

DrawShape draws the given shape

(pc *paint.Context, pos math32.Vector2, size float32, shape Shapes)

Source from the content-addressed store, hash-verified

39
40// DrawShape draws the given shape
41func DrawShape(pc *paint.Context, pos math32.Vector2, size float32, shape Shapes) {
42 switch shape {
43 case Ring:
44 DrawRing(pc, pos, size)
45 case Circle:
46 DrawCircle(pc, pos, size)
47 case Square:
48 DrawSquare(pc, pos, size)
49 case Box:
50 DrawBox(pc, pos, size)
51 case Triangle:
52 DrawTriangle(pc, pos, size)
53 case Pyramid:
54 DrawPyramid(pc, pos, size)
55 case Plus:
56 DrawPlus(pc, pos, size)
57 case Cross:
58 DrawCross(pc, pos, size)
59 }
60}
61
62func DrawRing(pc *paint.Context, pos math32.Vector2, size float32) {
63 pc.DrawCircle(pos.X, pos.Y, size)

Callers 2

PlotMethod · 0.85
ThumbnailMethod · 0.85

Calls 8

DrawRingFunction · 0.85
DrawCircleFunction · 0.85
DrawSquareFunction · 0.85
DrawBoxFunction · 0.85
DrawTriangleFunction · 0.85
DrawPyramidFunction · 0.85
DrawPlusFunction · 0.85
DrawCrossFunction · 0.85

Tested by

no test coverage detected