Rectangle returns a rectangle of width w and height h.
(w, h float64)
| 29 | |
| 30 | // Rectangle returns a rectangle of width w and height h. |
| 31 | func Rectangle(w, h float64) *Path { |
| 32 | if Equal(w, 0.0) || Equal(h, 0.0) { |
| 33 | return &Path{} |
| 34 | } |
| 35 | |
| 36 | p := &Path{} |
| 37 | p.LineTo(w, 0.0) |
| 38 | p.LineTo(w, h) |
| 39 | p.LineTo(0.0, h) |
| 40 | p.Close() |
| 41 | return p |
| 42 | } |
| 43 | |
| 44 | // RoundedRectangle returns a rectangle of width w and height h with rounded corners of radius r. A negative radius will cast the corners inwards (i.e. concave). |
| 45 | func RoundedRectangle(w, h, r float64) *Path { |