()
| 55 | } |
| 56 | |
| 57 | func (r *Rectangle) Mutate() { |
| 58 | w := r.Worker.W |
| 59 | h := r.Worker.H |
| 60 | rnd := r.Worker.Rnd |
| 61 | switch rnd.Intn(2) { |
| 62 | case 0: |
| 63 | r.X1 = clampInt(r.X1+int(rnd.NormFloat64()*16), 0, w-1) |
| 64 | r.Y1 = clampInt(r.Y1+int(rnd.NormFloat64()*16), 0, h-1) |
| 65 | case 1: |
| 66 | r.X2 = clampInt(r.X2+int(rnd.NormFloat64()*16), 0, w-1) |
| 67 | r.Y2 = clampInt(r.Y2+int(rnd.NormFloat64()*16), 0, h-1) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func (r *Rectangle) Rasterize() []Scanline { |
| 72 | x1, y1, x2, y2 := r.bounds() |
nothing calls this directly
no test coverage detected