public static Rectangle getAdjustedColumnBoundingRectangle(GraphicalEditPart editPart)
{
Rectangle bounds = editPart.getFigure().getBounds().getCopy();
if (editPart.getParent() != null) {
IFigure figure = ((GraphicalEditPart) editPart.getParent())
.getFigure();
if (figure instanceof CSSFigure) {
CSSFigure cssFigure = (CSSFigure) figure;
LayoutManager layoutManager = cssFigure.getLayoutManager();
if (layoutManager instanceof CSSTableLayout2) {
CSSTableLayout2 tableLayout = (CSSTableLayout2) layoutManager;
bounds.y = tableLayout.getHSpacing();
bounds.height = figure.getClientArea().height
- tableLayout.getHSpacing() * 2;
}
}
}
bounds = new PrecisionRectangle(bounds.getResized(-1, -1));