Source:
<code>private static ViewNodeContainerFigureDesc refreshBorder(final AbstractDiagramElementContainerEditPart self, final ViewNodeContainerFigureDesc primaryShape, final ContainerStyle style) { int borderSize = 0; if (style != null && style.getBorderSize() != null) { borderSize = style.getBorderSize().intValue(); } if (primaryShape instanceof Shape) { ((Shape) primaryShape).setLineWidth(borderSize); if (borderSize == 0) { ((Shape) primaryShape).setOutline(false); } else { ((Shape) primaryShape).setOutline(true); } } else if (primaryShape instanceof NodeFigure) { ((NodeFigure) primaryShape).setLineWidth(borderSize); } int labelOffset = IContainerLabelOffsets.LABEL_OFFSET; if (primaryShape.getLabelFigure() == null || !primaryShape.getLabelFigure().isVisible()) { labelOffset = 0; } if (primaryShape != null && primaryShape.getBorder() instanceof LineBorder) { ((LineBorder) primaryShape.getBorder()).setWidth(borderSize); if (primaryShape.getBorder() instanceof OneLineMarginBorder) { ((OneLineMarginBorder) primaryShape.getBorder()).setMargin(labelOffset, 0, 0, 0); } } else if (primaryShape != null && primaryShape.getBorder() instanceof MarginBorder) { MarginBorder margin = null; int borderMagin = borderSize; switch (self.getParentStackDirection()) { case PositionConstants.NORTH_SOUTH: <START> borderMagin = isFirstRegionPart(self) ? 0 : borderSize - 1; <END> margin = new MarginBorder(borderMagin + labelOffset, 0, 0, 0); break; case PositionConstants.EAST_WEST: borderMagin = isFirstRegionPart(self) ? 0 : borderSize; margin = new MarginBorder(labelOffset, borderMagin, 0, 0); break; case PositionConstants.NONE: default: margin = new MarginBorder(borderMagin + labelOffset - 1, borderMagin, borderMagin, borderMagin); } primaryShape.setBorder(margin); } return primaryShape; }</code><technical_language>return -1 Margin for 0, 1, 2 pixels ? a consistent computation change default size of existing diagrams (container, list 1 pixel border auto size)</technical_language>

Target:
private static ViewNodeContainerFigureDesc refreshBorder(final AbstractDiagramElementContainerEditPart self, final ViewNodeContainerFigureDesc primaryShape, final ContainerStyle style) { int borderSize = 0; if (style != null && style.getBorderSize() != null) { borderSize = style.getBorderSize().intValue(); } if (primaryShape instanceof Shape) { ((Shape) primaryShape).setLineWidth(borderSize); if (borderSize == 0) { ((Shape) primaryShape).setOutline(false); } else { ((Shape) primaryShape).setOutline(true); } } else if (primaryShape instanceof NodeFigure) { ((NodeFigure) primaryShape).setLineWidth(borderSize); } int labelOffset = IContainerLabelOffsets.LABEL_OFFSET; if (primaryShape.getLabelFigure() == null || !primaryShape.getLabelFigure().isVisible()) { labelOffset = 0; } if (primaryShape != null && primaryShape.getBorder() instanceof LineBorder) { ((LineBorder) primaryShape.getBorder()).setWidth(borderSize); if (primaryShape.getBorder() instanceof OneLineMarginBorder) { ((OneLineMarginBorder) primaryShape.getBorder()).setMargin(labelOffset, 0, 0, 0); } } else if (primaryShape != null && primaryShape.getBorder() instanceof MarginBorder) { MarginBorder margin = null; int borderMagin = borderSize; switch (self.getParentStackDirection()) { case PositionConstants.NORTH_SOUTH: borderMagin = isFirstRegionPart(self) ? 0 : (Math.max(borderSize - 1, 0)); margin = new MarginBorder(borderMagin + labelOffset, 0, 0, 0); break; case PositionConstants.EAST_WEST: borderMagin = isFirstRegionPart(self) ? 0 : borderSize; margin = new MarginBorder(labelOffset, borderMagin, 0, 0); break; case PositionConstants.NONE: default: margin = new MarginBorder(borderMagin + labelOffset - 1, borderMagin, borderMagin, borderMagin); } primaryShape.setBorder(margin); } return primaryShape; }