MCPcopy Create free account
hub / github.com/tdewolff/canvas / ToPath

Method ToPath

util.go:606–608  ·  view source on GitHub ↗

ToPath converts the rectangle to a path.

()

Source from the content-addressed store, hash-verified

604
605// ToPath converts the rectangle to a path.
606func (r Rect) ToPath() *Path {
607 return Rectangle(r.X1-r.X0, r.Y1-r.Y0).Translate(r.X0, r.Y0)
608}
609
610// String returns a string representation of r such as "(xmin,ymin)-(xmax,ymax)".
611func (r Rect) String() string {

Callers 6

TestRectFunction · 0.95
DrawPreviewWithAssetsFunction · 0.45
TestPolylineFunction · 0.45
drawFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

RectangleFunction · 0.85
TranslateMethod · 0.45

Tested by 2

TestRectFunction · 0.76
TestPolylineFunction · 0.36