GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.
(plt *plot.Plot)
| 266 | // GlyphBoxes implements the GlyphBoxes method |
| 267 | // of the plot.GlyphBoxer interface. |
| 268 | func (h *Contour) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox { |
| 269 | c, r := h.GridXYZ.Dims() |
| 270 | b := make([]plot.GlyphBox, 0, r*c) |
| 271 | for i := range c { |
| 272 | for j := range r { |
| 273 | b = append(b, plot.GlyphBox{ |
| 274 | X: plt.X.Norm(h.GridXYZ.X(i)), |
| 275 | Y: plt.Y.Norm(h.GridXYZ.Y(j)), |
| 276 | Rectangle: vg.Rectangle{ |
| 277 | Min: vg.Point{X: -2.5, Y: -2.5}, |
| 278 | Max: vg.Point{X: +2.5, Y: +2.5}, |
| 279 | }, |
| 280 | }) |
| 281 | } |
| 282 | } |
| 283 | return b |
| 284 | } |
| 285 | |
| 286 | // isLoop returns true iff a vg.Path is a closed loop. |
| 287 | func isLoop(p vg.Path) bool { |