(trX, trY func(float64) vg.Length)
| 411 | } |
| 412 | |
| 413 | func (c *contour) path(trX, trY func(float64) vg.Length) vg.Path { |
| 414 | var pa vg.Path |
| 415 | p := c.front() |
| 416 | pa.Move(vg.Point{X: trX(p.X), Y: trY(p.Y)}) |
| 417 | for i := len(c.backward) - 2; i >= 0; i-- { |
| 418 | p = c.backward[i] |
| 419 | pa.Line(vg.Point{X: trX(p.X), Y: trY(p.Y)}) |
| 420 | } |
| 421 | for _, p := range c.forward { |
| 422 | pa.Line(vg.Point{X: trX(p.X), Y: trY(p.Y)}) |
| 423 | } |
| 424 | |
| 425 | return pa |
| 426 | } |
| 427 | |
| 428 | // front returns the first point in the contour. |
| 429 | func (c *contour) front() point { return c.backward[len(c.backward)-1] } |
no test coverage detected