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

Method Draw

plot/line.go:54–63  ·  view source on GitHub ↗

Draw draws a line between given coordinates, setting the stroke style to current parameters. Returns false if either Width = 0 or Color = nil

(pt *Plot, start, end math32.Vector2)

Source from the content-addressed store, hash-verified

52// Draw draws a line between given coordinates, setting the stroke style
53// to current parameters. Returns false if either Width = 0 or Color = nil
54func (ls *LineStyle) Draw(pt *Plot, start, end math32.Vector2) bool {
55 if !ls.SetStroke(pt) {
56 return false
57 }
58 pc := pt.Paint
59 pc.MoveTo(start.X, start.Y)
60 pc.LineTo(end.X, end.Y)
61 pc.Stroke()
62 return true
63}

Callers

nothing calls this directly

Calls 4

SetStrokeMethod · 0.95
MoveToMethod · 0.80
LineToMethod · 0.80
StrokeMethod · 0.80

Tested by

no test coverage detected