Browse Source

Fix for Rectangle::constrainedWithin()

tags/2021-05-28
jules 12 years ago
parent
commit
79cad7771a
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_graphics/geometry/juce_Rectangle.h

+ 2
- 2
modules/juce_graphics/geometry/juce_Rectangle.h View File

@@ -612,8 +612,8 @@ public:
*/
Rectangle constrainedWithin (const Rectangle& areaToFitWithin) const noexcept
{
const int newW = jmin (w, areaToFitWithin.getWidth());
const int newH = jmin (h, areaToFitWithin.getHeight());
const ValueType newW (jmin (w, areaToFitWithin.getWidth()));
const ValueType newH (jmin (h, areaToFitWithin.getHeight()));
return Rectangle (jlimit (areaToFitWithin.getX(), areaToFitWithin.getRight() - newW, pos.x),
jlimit (areaToFitWithin.getY(), areaToFitWithin.getBottom() - newH, pos.y),


Loading…
Cancel
Save