Defines the method used to postion some kind of rectangular object within a rectangular viewport. More...
Public Types | |
| enum | { xLeft = 1, xRight = 2, xMid = 4, yTop = 8, yBottom = 16, yMid = 32, stretchToFit = 64, fillDestination = 128, onlyReduceInSize = 256, onlyIncreaseInSize = 512, doNotResize = (onlyIncreaseInSize | onlyReduceInSize), centred = 4 + 32 } |
Flag values that can be combined and used in the constructor. More... | |
Public Member Functions | |
| RectanglePlacement (int flags_) noexcept | |
| Creates a RectanglePlacement object using a combination of flags. | |
| RectanglePlacement (const RectanglePlacement &other) noexcept | |
| Creates a copy of another RectanglePlacement object. | |
| RectanglePlacement & | operator= (const RectanglePlacement &other) noexcept |
| Copies another RectanglePlacement object. | |
| bool | operator== (const RectanglePlacement &other) const noexcept |
| bool | operator!= (const RectanglePlacement &other) const noexcept |
| int | getFlags () const noexcept |
| Returns the raw flags that are set for this object. | |
| bool | testFlags (int flagsToTest) const noexcept |
| Tests a set of flags for this object. | |
| void | applyTo (double &sourceX, double &sourceY, double &sourceW, double &sourceH, double destinationX, double destinationY, double destinationW, double destinationH) const noexcept |
| Adjusts the position and size of a rectangle to fit it into a space. | |
| template<typename ValueType > | |
| const Rectangle< ValueType > | appliedTo (const Rectangle< ValueType > &source, const Rectangle< ValueType > &destination) const noexcept |
| Returns the transform that should be applied to these source co-ordinates to fit them into the destination rectangle using the current flags. | |
| const AffineTransform | getTransformToFit (const Rectangle< float > &source, const Rectangle< float > &destination) const noexcept |
| Returns the transform that should be applied to these source co-ordinates to fit them into the destination rectangle using the current flags. | |
Defines the method used to postion some kind of rectangular object within a rectangular viewport.
Although similar to Justification, this is more specific, and has some extra options.
| anonymous enum |
Flag values that can be combined and used in the constructor.
| RectanglePlacement::RectanglePlacement | ( | int | flags_ ) |
Creates a RectanglePlacement object using a combination of flags.
| RectanglePlacement::RectanglePlacement | ( | const RectanglePlacement & | other ) |
Creates a copy of another RectanglePlacement object.
| RectanglePlacement& RectanglePlacement::operator= | ( | const RectanglePlacement & | other ) |
Copies another RectanglePlacement object.
| bool RectanglePlacement::operator== | ( | const RectanglePlacement & | other ) | const |
| bool RectanglePlacement::operator!= | ( | const RectanglePlacement & | other ) | const |
| int RectanglePlacement::getFlags | ( | ) | const |
Returns the raw flags that are set for this object.
| bool RectanglePlacement::testFlags | ( | int | flagsToTest ) | const |
Tests a set of flags for this object.
| void RectanglePlacement::applyTo | ( | double & | sourceX, |
| double & | sourceY, | ||
| double & | sourceW, | ||
| double & | sourceH, | ||
| double | destinationX, | ||
| double | destinationY, | ||
| double | destinationW, | ||
| double | destinationH | ||
| ) | const |
Adjusts the position and size of a rectangle to fit it into a space.
The source rectangle co-ordinates will be adjusted so that they fit into the destination rectangle based on this object's flags.
| const Rectangle<ValueType> RectanglePlacement::appliedTo | ( | const Rectangle< ValueType > & | source, |
| const Rectangle< ValueType > & | destination | ||
| ) | const |
Returns the transform that should be applied to these source co-ordinates to fit them into the destination rectangle using the current flags.
References Rectangle< ValueType >::getX().
| const AffineTransform RectanglePlacement::getTransformToFit | ( | const Rectangle< float > & | source, |
| const Rectangle< float > & | destination | ||
| ) | const |
Returns the transform that should be applied to these source co-ordinates to fit them into the destination rectangle using the current flags.