NewLineHatch returns a new line hatch pattern with lines at an angle with a spacing of distance. Thickness is the stroke thickness applied to the shape; stroking is ignored with thickness is zero.
(ifill any, angle, distance, thickness float64)
| 134 | |
| 135 | // NewLineHatch returns a new line hatch pattern with lines at an angle with a spacing of distance. Thickness is the stroke thickness applied to the shape; stroking is ignored with thickness is zero. |
| 136 | func NewLineHatch(ifill any, angle, distance, thickness float64) *HatchPattern { |
| 137 | cell := Identity.Rotate(angle).Scale(distance, distance) |
| 138 | return NewHatchPattern(ifill, thickness, cell, func(x0, y0, x1, y1 float64) *Path { |
| 139 | p := &Path{} |
| 140 | for y := math.Floor(y0); y <= y1; y += 1.0 { |
| 141 | p.MoveTo(x0, y) |
| 142 | p.LineTo(x1, y) |
| 143 | } |
| 144 | return p |
| 145 | }) |
| 146 | } |
| 147 | |
| 148 | // NewCrossHatch returns a new cross hatch pattern of two regular line hatches at different angles and with different distance intervals. Thickness is the stroke thickness applied to the shape; stroking is ignored with thickness is zero. |
| 149 | func NewCrossHatch(ifill any, angle0, angle1, distance0, distance1, thickness float64) *HatchPattern { |