double pixPerCm10 = canvas.getPPCDrawing()*canvas.getZoom()/10.;
if(ScaleRuler.getUnit()==Unit.INCH)
pixPerCm10*=PSTricksConstants.INCH_VAL_CM;
if(Double.compare(pixPerCm10, 4.)>0) {
final Line2D line = new Line2D.Double();
final double xMinclip = Math.floor(clip.getMinX()/pixPerCm10)*pixPerCm10-clip.getMinX();
final double yMinclip = Math.floor(clip.getMinY()/pixPerCm10)*pixPerCm10-clip.getMinY();
final double xMaxclip = clip.getMaxX();
final double yMaxclip = clip.getMaxY();
final double minX = clip.getMinX();
final double minY = clip.getMinY();
for(double i=pixPerCm10-1+xMinclip+minX+canvas.getOrigin().getX()%pixPerCm10; i<xMaxclip; i+=pixPerCm10) {
line.setLine(i, minY, i, yMaxclip);
graph.draw(line);
}
for(double i=pixPerCm10-1+yMinclip+minY+canvas.getOrigin().getY()%pixPerCm10; i<yMaxclip; i+=pixPerCm10) {
line.setLine(minX, i, xMaxclip, i);
graph.draw(line);
}
}
}