if(LNumber.equalsDouble(angle2, 0.))
// Drawing the hatchings vertically.
for(double x = nwx; x<sex; x+=val) {
path.add(new SVGPathSegMoveto(x, nwy, false));
path.add(new SVGPathSegLineto(x, sey, false));
}
else
// Drawing the hatchings horizontally.
if(LNumber.equalsDouble(angle2, halphPI) || LNumber.equalsDouble(angle2, -halphPI))
for(double y = nwy; y<sey; y+=val) {
path.add(new SVGPathSegMoveto(nwx, y, false));
path.add(new SVGPathSegLineto(sex, y, false));
}
else {
// Drawing the hatchings by rotation.
final double incX = val/Math.cos(angle2);
final double incY = val/Math.sin(angle2);
final double maxX;
double y1;
double x2;
final double y2;
final double x1;
if(angle2>0.) {
y1 = nwy;
maxX = sex + (sey-(nwy<0?nwy:0)) * Math.tan(angle2);
}
else {
y1 = sey;
maxX = sex - sey * Math.tan(angle2);
}
x1 = nwx;
x2 = x1;
y2 = y1;
if(incX<0. || LNumber.equalsDouble(incX, 0.))
return ;
while(x2 < maxX) {
x2 += incX;
y1 += incY;
path.add(new SVGPathSegMoveto(x1, y1, false));
path.add(new SVGPathSegLineto(x2, y2, false));
}
}
}