private double toSVGSquareBracket(final SVGDocument doc, final double lineWidth, final boolean isShadow, final SVGElement marker) {
final IShape shape = arrow.getShape();
final SVGPathElement bar = new SVGPathElement(doc);
final double width = arrow.getTBarSizeDim() + arrow.getTBarSizeNum()*lineWidth;
final SVGPathSegList path = new SVGPathSegList();
final double lgth = arrow.getBracketNum()*(arrow.getTBarSizeDim()/IShape.PPC + arrow.getTBarSizeNum()*lineWidth)/lineWidth;
final boolean isInverted = arrow.isInverted();//FIXME shape.PPC
final double gapPostion;
if(arrow.getArrowStyle()==ArrowStyle.LEFT_SQUARE_BRACKET) {
final double lgth2 = isInverted ? -lgth : 0.;
path.add(new SVGPathSegMoveto(lgth+lgth2+0.5, -width/(lineWidth*2)+0.5, false));
path.add(new SVGPathSegLineto(lgth2, -width/(lineWidth*2)+0.5, false));
path.add(new SVGPathSegLineto(lgth2, width/(lineWidth*2)-0.5, false));
path.add(new SVGPathSegLineto(lgth+lgth2+0.5, width/(lineWidth*2)-0.5, false));
gapPostion = isInverted ? -lineWidth/4. : -lineWidth/2.;
}
else {
final double lgth2 = isInverted ? lgth : 0.;
path.add(new SVGPathSegMoveto(-lgth+lgth2-0.5, -width/(lineWidth*2)+0.5, false));
path.add(new SVGPathSegLineto(lgth2, -width/(lineWidth*2)+0.5, false));
path.add(new SVGPathSegLineto(lgth2, width/(lineWidth*2)-0.5, false));
path.add(new SVGPathSegLineto(-lgth+lgth2-0.5, width/(lineWidth*2)-0.5, false));
gapPostion = isInverted ? lineWidth/4. : lineWidth/2.;
}
marker.appendChild(bar);
bar.setAttribute(LNamespace.LATEXDRAW_NAMESPACE+':'+LNamespace.XML_ARROW_TBAR_SIZE_NUM, String.valueOf(arrow.getTBarSizeNum()));
bar.setAttribute(SVGAttributes.SVG_STROKE, CSSColors.INSTANCE.getColorName(isShadow ? shape.getShadowCol() : shape.getLineColour(), true));
bar.setAttribute(SVGAttributes.SVG_FILL, SVGAttributes.SVG_VALUE_NONE);
bar.setPathData(path);
bar.setAttribute(SVGAttributes.SVG_STROKE_WIDTH, "1"); //$NON-NLS-1$
return gapPostion;
}