### Eclipse Workspace Patch 1.0 #P org.eclipse.gef Index: src/org/eclipse/gef/editpolicies/SnapFeedbackPolicy.java =================================================================== RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/editpolicies/SnapFeedbackPolicy.java,v retrieving revision 1.19 diff -u -r1.19 SnapFeedbackPolicy.java --- src/org/eclipse/gef/editpolicies/SnapFeedbackPolicy.java 12 Aug 2005 04:31:19 -0000 1.19 +++ src/org/eclipse/gef/editpolicies/SnapFeedbackPolicy.java 22 Nov 2007 18:24:21 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. + * Copyright (c) 2003, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -135,10 +135,13 @@ //pos is an integer relative to target's client area. //translate pos to absolute, and then make it relative to fig. int position = pos.intValue(); - PrecisionPoint loc = new PrecisionPoint(position, position); - IFigure contentPane = ((GraphicalEditPart)getHost()).getContentPane(); + PrecisionPoint loc = new PrecisionPoint(position, position); + IFigure contentPane = ((GraphicalEditPart)getHost().getViewer().getContents()).getContentPane(); contentPane.translateToParent(loc); + contentPane.translateToAbsolute(loc); + + if (location[offset] == null || !location[offset].equals(pos)) { location[offset] = pos; @@ -150,7 +153,7 @@ IFigure fig = new FadeIn(color); guide[offset] = fig; addFeedback(fig); - fig.translateToRelative(loc); + fig.translateToRelative(loc); position = offset % 2 == 0 ? (int)Math.round(loc.preciseX) : (int)Math.round(loc.preciseY); Rectangle figBounds = getFeedbackLayer().getBounds().getCopy(); @@ -160,14 +163,14 @@ } else { figBounds.x = position; figBounds.width = 1; - } + } fig.setBounds(figBounds); } else { // The feedback layer could have grown (if auto-scrolling), so resize the fade-in // line. IFigure fig = guide[offset]; - Rectangle figBounds = fig.getBounds().getCopy(); - Rectangle feedbackBounds = getFeedbackLayer().getBounds(); + Rectangle figBounds = fig.getBounds().getCopy(); + Rectangle feedbackBounds = getFeedbackLayer().getBounds(); if ((offset % 2) == 1) { figBounds.x = feedbackBounds.x; figBounds.width = feedbackBounds.width; @@ -175,6 +178,7 @@ figBounds.y = feedbackBounds.y; figBounds.height = feedbackBounds.height; } + fig.setBounds(figBounds); } }