A specialized ComponentBoundsConstrainer that applies border constraints and maintains aspect ratios for the Vital GUI window.
More...
|
| BorderBoundsConstrainer () |
| Constructs a new BorderBoundsConstrainer with no associated GUI and default border settings.
|
|
virtual void | checkBounds (Rectangle< int > &bounds, const Rectangle< int > &previous, const Rectangle< int > &limits, bool stretching_top, bool stretching_left, bool stretching_bottom, bool stretching_right) override |
| Adjusts the given bounds to enforce border constraints, maintain aspect ratio, and limit the window size based on display characteristics.
|
|
virtual void | resizeStart () override |
| Called before a resize operation begins.
|
|
virtual void | resizeEnd () override |
| Called after a resize operation finishes.
|
|
void | setBorder (const BorderSize< int > &border) |
| Sets the border size that should be enforced during resizing.
|
|
void | setGui (FullInterface *gui) |
| Associates a FullInterface instance with this constrainer.
|
|
A specialized ComponentBoundsConstrainer that applies border constraints and maintains aspect ratios for the Vital GUI window.
This class ensures that when the Vital window is resized, it adheres to certain borders, respects a fixed aspect ratio, and integrates with the main GUI interface to perform special actions at the start and end of a resize operation.
void BorderBoundsConstrainer::checkBounds |
( |
Rectangle< int > & | bounds, |
|
|
const Rectangle< int > & | previous, |
|
|
const Rectangle< int > & | limits, |
|
|
bool | stretching_top, |
|
|
bool | stretching_left, |
|
|
bool | stretching_bottom, |
|
|
bool | stretching_right ) |
|
overridevirtual |
Adjusts the given bounds to enforce border constraints, maintain aspect ratio, and limit the window size based on display characteristics.
- Parameters
-
bounds | The proposed new bounds of the component. |
previous | The previous bounds of the component before resizing. |
limits | The limits within which the component must fit. |
stretching_top | True if the top edge is being dragged. |
stretching_left | True if the left edge is being dragged. |
stretching_bottom | True if the bottom edge is being dragged. |
stretching_right | True if the right edge is being dragged. |
This method first adjusts the bounds by subtracting the set border, then calls the base class implementation to apply standard constraints. It also ensures that the resulting window size does not exceed the available display area, preserving the fixed aspect ratio.