diff --git a/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp b/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp index 4873ea7e77..a57734b487 100644 --- a/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_TooltipWindow.cpp @@ -97,8 +97,8 @@ void TooltipWindow::showFor (const String& tip) else y += 6; - x = jlimit (parentArea.getX(), parentArea.getRight() - w, x); - y = jlimit (parentArea.getY(), parentArea.getBottom() - h, y); + x = jmax (parentArea.getX(), jmin (parentArea.getRight() - w, x)); + y = jmax (parentArea.getY(), jmin (parentArea.getBottom() - h, y)); setBounds (x, y, w, h); setVisible (true);