DrawPath draws a path at position (x,y) using the current draw state.
(x, y float64, paths ...*Path)
| 636 | |
| 637 | // DrawPath draws a path at position (x,y) using the current draw state. |
| 638 | func (c *Context) DrawPath(x, y float64, paths ...*Path) { |
| 639 | if !c.Style.HasFill() && !c.Style.HasStroke() { |
| 640 | return |
| 641 | } |
| 642 | |
| 643 | style := c.Style |
| 644 | m := c.CoordSystemView() |
| 645 | |
| 646 | // get view |
| 647 | coord := c.coordView.Dot(Point{x, y}) |
| 648 | m = m.Mul(c.view).Translate(coord.X, coord.Y) |
| 649 | |
| 650 | dashes := style.Dashes |
| 651 | for _, path := range paths { |
| 652 | var ok bool |
| 653 | style.Dashes, ok = path.checkDash(c.Style.DashOffset, dashes) |
| 654 | if !ok { |
| 655 | style.Stroke = Paint{} |
| 656 | } |
| 657 | c.RenderPath(path, style, m) |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | // DrawText draws text at position (x,y) using the current draw state. |
| 662 | func (c *Context) DrawText(x, y float64, text *Text) { |