xStep *= shape.getGridEndX()<shape.getGridStartX() ? -1 : 1 ;
yStep *= shape.getGridEndY()<shape.getGridStartY() ? -1 : 1 ;
xSubStep = xStep/subGridDiv;
ySubStep = yStep/subGridDiv;
final int subGridDots = shape.getSubGridDots();
final IPoint tl = shape.getTopLeftPoint();
final IPoint br = shape.getBottomRightPoint();
double tlx = tl.getX();
double tly = tl.getY();
double brx = br.getX();
double bry = br.getY();
final double minX = shape.getGridMinX();
final double maxX = shape.getGridMaxX();
final double minY = shape.getGridMinY();
final double maxY = shape.getGridMaxY();
final double absStep = Math.abs(xStep);
final Color subGridColor= shape.getSubGridColour();
final Color linesColor = shape.getLineColour();
final double gridWidth = shape.getGridWidth();
final double posX = Math.min(shape.getGridStartX(), shape.getGridEndX())*IShape.PPC*unit;
final double posY = -Math.min(shape.getGridStartY(), shape.getGridEndY())*IShape.PPC*unit;
final IPoint position = shape.getPosition();
tlx -= position.getX();
brx -= position.getX();
tly -= position.getY();
bry -= position.getY();
elt.setAttribute(SVGAttributes.SVG_TRANSFORM, SVGTransform.createTranslation(position.getX(), position.getY()).toString());
// Creation of the sub-grid
if(subGridDots>0)
createSVGSubGridDots(document, elt, prefix, subGridDiv, unit, xSubStep, ySubStep, minX, maxX, minY, maxY, subGridDots, shape.getSubGridWidth(),
tlx, tly, brx, bry, subGridColor);