Source:
<code>private Point calculateCenterLocation(IGraphicalEditPart host, CompoundCommand cc, IAdaptable iAdaptable, Point previousCenterLocation) { Rectangle rect = new Rectangle(); rect.setSize(LayoutHelper.UNDEFINED.getSize()); Point centerLocation; if (previousCenterLocation == null) { Point referencePoint = getLayoutHelper().getReferencePosition(host.getContentPane(), ((FigureCanvas) host.getViewer().getControl()).getViewport(), host); rect.setLocation(referencePoint); Point point = getLayoutHelper().validatePosition(host.getContentPane(), rect); PrecisionPoint result = new PrecisionPoint(point); <START> GraphicalHelper.applyZoomOnPoint(host, <END> result); SnapToHelper helper = host.getAdapter(SnapToHelper.class); if (helper != null) { PrecisionPoint preciseLocation = new PrecisionPoint(result); helper.snapPoint(new CreateRequest(), PositionConstants.HORIZONTAL | PositionConstants.VERTICAL, preciseLocation, result); } GraphicalHelper.applyInverseZoomOnPoint(host, result); rect.setLocation(result); centerLocation = result.getCopy(); } else { int padding = SiriusLayoutDataManager.PADDING; if (GraphicalHelper.isSnapToGridEnabled(host)) { padding = GraphicalHelper.getGridSpacing(host); } centerLocation = new Point(previousCenterLocation).getTranslated(padding, padding); } IGraphicalEditPart part = (IGraphicalEditPart) host.getViewer().getEditPartRegistry().get(iAdaptable.getAdapter(View.class)); cc.add(new ICommandProxy(new SetBoundsCommand(host.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, part, centerLocation))); return centerLocation.getCopy(); }</code><technical_language>applyZoomOnPoint enough. screen2logical(Point point, GraphicalEditPart part) handle scroll</technical_language>

Target:
private Point calculateCenterLocation(IGraphicalEditPart host, CompoundCommand cc, IAdaptable iAdaptable, Point previousCenterLocation) { Rectangle rect = new Rectangle(); rect.setSize(LayoutHelper.UNDEFINED.getSize()); Point centerLocation; if (previousCenterLocation == null) { Point referencePoint = getLayoutHelper().getReferencePosition(host.getContentPane(), ((FigureCanvas) host.getViewer().getControl()).getViewport(), host); rect.setLocation(referencePoint); Point point = getLayoutHelper().validatePosition(host.getContentPane(), rect); PrecisionPoint result = new PrecisionPoint(point); GraphicalHelper.logical2screen(result, host); SnapToHelper helper = host.getAdapter(SnapToHelper.class); if (helper != null) { PrecisionPoint preciseLocation = new PrecisionPoint(result); helper.snapPoint(new CreateRequest(), PositionConstants.HORIZONTAL | PositionConstants.VERTICAL, preciseLocation, result); } GraphicalHelper.screen2logical(result, host); rect.setLocation(result); centerLocation = result.getCopy(); } else { int padding = SiriusLayoutDataManager.PADDING; if (GraphicalHelper.isSnapToGridEnabled(host)) { padding = GraphicalHelper.getGridSpacing(host); } centerLocation = new Point(previousCenterLocation).getTranslated(padding, padding); } IGraphicalEditPart part = (IGraphicalEditPart) host.getViewer().getEditPartRegistry().get(iAdaptable.getAdapter(View.class)); cc.add(new ICommandProxy(new SetBoundsCommand(host.getEditingDomain(), DiagramUIMessages.SetLocationCommand_Label_Resize, part, centerLocation))); return centerLocation.getCopy(); }