commit | b80771855aca8bb704ea4a5c3f93dc8313b940a8 | [log] [tgz] |
---|---|---|
author | rdayal@google.com <rdayal@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Apr 06 14:59:00 2012 +0000 |
committer | rdayal@google.com <rdayal@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Apr 06 14:59:00 2012 +0000 |
tree | 6f7f590a128f88cf9c09af93c1e4181930893b99 | |
parent | 7c9c31cf6d32fb61567d26cb0776930390f59e4d [diff] |
Fix for: http://code.google.com/p/google-web-toolkit/issues/detail?id=4221 Review at: http://gwt-code-reviews.appspot.com/1573803 Patch by: stephenh Review by: jlabanca@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10939 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/ui/PopupPanel.java b/user/src/com/google/gwt/user/client/ui/PopupPanel.java index 19e7931..8460eb4 100644 --- a/user/src/com/google/gwt/user/client/ui/PopupPanel.java +++ b/user/src/com/google/gwt/user/client/ui/PopupPanel.java
@@ -523,6 +523,14 @@ show(); } + // If left/top are set from a previous center() call, and our content + // has changed, we may get a bogus getOffsetWidth because our new content + // is wrapping (giving a lower offset width) then it would without the + // previous left. Setting left/top back to 0 avoids this. + Element elem = getElement(); + elem.getStyle().setPropertyPx("left", 0); + elem.getStyle().setPropertyPx("top", 0); + int left = (Window.getClientWidth() - getOffsetWidth()) >> 1; int top = (Window.getClientHeight() - getOffsetHeight()) >> 1; setPopupPosition(Math.max(Window.getScrollLeft() + left, 0), Math.max(