From: Matti Tahvonen Date: Mon, 28 Dec 2009 12:57:14 +0000 (+0000) Subject: fixes #3882, tooltips now positioned on top of the screen if they don't fit below... X-Git-Tag: 6.7.0.beta1~2084^2~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a555a27a8c52c5f5264fd772c51ec028b154cd7;p=vaadin-framework.git fixes #3882, tooltips now positioned on top of the screen if they don't fit below or above svn changeset:10552/svn branch:6.2 --- diff --git a/src/com/vaadin/terminal/gwt/client/VTooltip.java b/src/com/vaadin/terminal/gwt/client/VTooltip.java index b42b4f3bf3..f9a3c70c61 100644 --- a/src/com/vaadin/terminal/gwt/client/VTooltip.java +++ b/src/com/vaadin/terminal/gwt/client/VTooltip.java @@ -91,6 +91,11 @@ public class VTooltip extends VOverlay { if (y + offsetHeight + MARGIN - Window.getScrollTop() > Window .getClientHeight()) { y = tooltipEventMouseY - 5 - offsetHeight; + if (y - Window.getScrollTop() < 0) { + // tooltip does not fit on top of the mouse either, + // put it at the top of the screen + y = Window.getScrollTop(); + } } setPopupPosition(x, y);