changeset 3692:e470e4efc8dc

RT-30307: Shifted combo pop-up when embedded in SWT [toDisplay() needs coordinates relative to the client area of the control, calling it with getLocation() feeds it the position in the parent]
author snorthov
date Mon, 27 May 2013 12:17:24 -0400
parents 4974dfa78b67
children 223392e7cdf1
files javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java	Mon May 27 16:06:11 2013 +0200
+++ b/javafx-embed-swt/src/javafx/embed/swt/FXCanvas.java	Mon May 27 12:17:24 2013 -0400
@@ -89,6 +89,7 @@
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.graphics.PaletteData;
 import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ControlListener;
@@ -442,7 +443,8 @@
         if ((stagePeer == null) /*|| !isShowing()*/) {
             return;
         }
-        Point los = toDisplay(getLocation());
+        Rectangle rect = getClientArea();
+        Point los = toDisplay(rect.x, rect.y);
         stagePeer.setLocation(los.x, los.y);
     }