Rectangle rect = null;
// Takes rotation into account
double rotation = mxUtils.getDouble(state.getStyle(),
mxConstants.STYLE_ROTATION);
mxRectangle tmp = mxUtils.getBoundingBox(new mxRectangle(state),
rotation);
// Adds scaled stroke width
int border = (int) Math
.ceil(mxUtils.getDouble(state.getStyle(),
mxConstants.STYLE_STROKEWIDTH)
* graph.getView().getScale()) + 1;
tmp.grow(border);
if (mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_SHADOW))
{
tmp.setWidth(tmp.getWidth() + mxConstants.SHADOW_OFFSETX);
tmp.setHeight(tmp.getHeight() + mxConstants.SHADOW_OFFSETX);
}
// Adds the bounds of the label
if (state.getLabelBounds() != null)
{
tmp.add(state.getLabelBounds());
}
rect = tmp.getRectangle();
return rect;
}