33 bool isStretchingLeft,
34 bool isStretchingBottom,
35 bool isStretchingRight)
40 const auto requestedBounds = bounds;
42 border.subtractFrom (bounds);
43 decorated->checkBounds (bounds,
44 border.subtractedFrom (previousBounds),
50 border.addTo (bounds);
51 bounds = bounds.
withPosition (requestedBounds.getPosition());
53 if (isStretchingTop && ! isStretchingBottom)
56 if (! isStretchingTop && isStretchingBottom)
57 bounds = bounds.
withY (previousBounds.
getY());
59 if (isStretchingLeft && ! isStretchingRight)
62 if (! isStretchingLeft && isStretchingRight)
63 bounds = bounds.
withX (previousBounds.
getX());
void checkBounds(Rectangle< int > &bounds, const Rectangle< int > &previousBounds, const Rectangle< int > &limits, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight) override
This callback changes the given coordinates to impose whatever the current constraints are set to be.
virtual BorderSize< int > getAdditionalBorder() const =0
Returns the border that should be applied to the constrained bounds.
virtual ComponentBoundsConstrainer * getWrappedConstrainer() const =0
Returns a pointer to another constrainer that will be used as the base for any resizing operations.
virtual void checkBounds(Rectangle< int > &bounds, const Rectangle< int > &previousBounds, const Rectangle< int > &limits, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight)
This callback changes the given coordinates to impose whatever the current constraints are set to be.
Manages a rectangle and allows geometric operations to be performed on it.
ValueType getRight() const noexcept
Returns the x coordinate of the rectangle's right-hand-side.
Rectangle withX(ValueType newX) const noexcept
Returns a rectangle which has the same size and y-position as this one, but with a different x-positi...
Rectangle withPosition(ValueType newX, ValueType newY) const noexcept
Returns a rectangle with the same size as this one, but a new position.
Rectangle withBottomY(ValueType newBottomY) const noexcept
Returns a rectangle which has the same size and x-position as this one, but whose bottom edge has the...
ValueType getX() const noexcept
Returns the x coordinate of the rectangle's left-hand-side.
ValueType getBottom() const noexcept
Returns the y coordinate of the rectangle's bottom edge.
ValueType getY() const noexcept
Returns the y coordinate of the rectangle's top edge.
Rectangle withRightX(ValueType newRightX) const noexcept
Returns a rectangle which has the same size and y-position as this one, but whose right-hand edge has...
Rectangle withY(ValueType newY) const noexcept
Returns a rectangle which has the same size and x-position as this one, but with a different y-positi...