diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/requests/ChangeBoundsRequest.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/requests/ChangeBoundsRequest.java index 7f519d291..27e2bae04 100644 --- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/requests/ChangeBoundsRequest.java +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/requests/ChangeBoundsRequest.java @@ -27,6 +27,7 @@ */ public class ChangeBoundsRequest extends GroupRequest implements DropRequest { private static final int SNAP_TO = 16; + private Point m_mouseAbsoluteLocation; private Point m_mouseLocation; private Point m_moveDelta = new Point(); private Dimension m_resizeDelta = new Dimension(); @@ -57,17 +58,37 @@ public ChangeBoundsRequest(Object type) { // //////////////////////////////////////////////////////////////////////////// /** - * Returns the location of the mouse pointer. + * Returns the absolute location of the mouse pointer. + * + * @deprecated Use {@link #getRelativeLocation()} instead. */ @Override + @Deprecated public Point getLocation() { + return m_mouseAbsoluteLocation; + } + + /** + * Sets the absolute location of the mouse pointer. + * + * @deprecated Use {@link #setRelativeLocation(Point)} instead. + */ + @Deprecated + public void setLocation(Point absoluteLocation) { + m_mouseAbsoluteLocation = absoluteLocation; + } + + /** + * Returns the location of the mouse pointer. + */ + public Point getRelativeLocation() { return m_mouseLocation; } /** * Sets the location of the mouse pointer. */ - public void setLocation(Point location) { + public void setRelativeLocation(Point location) { m_mouseLocation = location; } diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/tools/DragEditPartTracker.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/tools/DragEditPartTracker.java index dd8e7dda1..e64040828 100644 --- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/tools/DragEditPartTracker.java +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/core/tools/DragEditPartTracker.java @@ -204,12 +204,14 @@ protected Request createTargetRequest() { * location and type. */ @Override + @SuppressWarnings("deprecation") protected void updateTargetRequest() { super.updateTargetRequest(); ChangeBoundsRequest request = (ChangeBoundsRequest) getTargetRequest(); request.setEditParts(getOperationSet()); request.setMoveDelta(new Point(getDragMoveDelta())); request.setLocation(getAbsoluteLocation()); + request.setRelativeLocation(getLocation()); } @Override diff --git a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/graphical/tools/ResizeTracker.java b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/graphical/tools/ResizeTracker.java index 5b9a37470..74b714f59 100644 --- a/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/graphical/tools/ResizeTracker.java +++ b/org.eclipse.wb.core/src-gef/org/eclipse/wb/gef/graphical/tools/ResizeTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2025 Google, Inc. and others. + * Copyright (c) 2011, 2026 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -229,6 +229,7 @@ protected List createOperationSet() { * Updates the request with the current {@link Tool#getOperationSet() operation set}, move delta, * size delta and location. */ + @SuppressWarnings("deprecation") private void updateRequest() { // create request if (getRequest() == null) { @@ -261,6 +262,7 @@ private void updateRequest() { getRequest().setMoveDelta(corner); getRequest().setSizeDelta(resize); getRequest().setLocation(getAbsoluteLocation()); + getRequest().setRelativeLocation(getLocation()); } /**