]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #3099 - PopupView is shown off screen
authorArtur Signell <artur.signell@itmill.com>
Mon, 29 Jun 2009 13:59:01 +0000 (13:59 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 29 Jun 2009 13:59:01 +0000 (13:59 +0000)
svn changeset:8264/svn branch:6.0

src/com/vaadin/terminal/gwt/client/ui/VPopupView.java

index c6041d71d103c7e352966d3a97e9efd6087bfdbd..1bdefe63729c65fcdab97a203cbfebde361e5b3d 100644 (file)
@@ -160,7 +160,7 @@ public class VPopupView extends HTML implements Container {
         int left = hostHorizontalCenter - offsetWidth / 2;
         int top = hostVerticalCenter - offsetHeight / 2;
 
-        // Superclass takes care of top and left
+        // Don't show the popup outside the screen.
         if ((left + offsetWidth) > windowRight) {
             left -= (left + offsetWidth) - windowRight;
         }
@@ -169,6 +169,14 @@ public class VPopupView extends HTML implements Container {
             top -= (top + offsetHeight) - windowBottom;
         }
 
+        if (left < 0) {
+            left = 0;
+        }
+
+        if (top < 0) {
+            top = 0;
+        }
+
         popup.setPopupPosition(left, top);
 
         popup.setVisible(true);