Specifies a set of gaps to be left around the sides of a rectangle. More...
Public Member Functions | |
| BorderSize () noexcept | |
| Creates a null border. | |
| BorderSize (const BorderSize &other) noexcept | |
| Creates a copy of another border. | |
| BorderSize (ValueType topGap, ValueType leftGap, ValueType bottomGap, ValueType rightGap) noexcept | |
| Creates a border with the given gaps. | |
| BorderSize (ValueType allGaps) noexcept | |
| Creates a border with the given gap on all sides. | |
| ValueType | getTop () const noexcept |
| Returns the gap that should be left at the top of the region. | |
| ValueType | getLeft () const noexcept |
| Returns the gap that should be left at the top of the region. | |
| ValueType | getBottom () const noexcept |
| Returns the gap that should be left at the top of the region. | |
| ValueType | getRight () const noexcept |
| Returns the gap that should be left at the top of the region. | |
| ValueType | getTopAndBottom () const noexcept |
| Returns the sum of the top and bottom gaps. | |
| ValueType | getLeftAndRight () const noexcept |
| Returns the sum of the left and right gaps. | |
| bool | isEmpty () const noexcept |
| Returns true if this border has no thickness along any edge. | |
| void | setTop (ValueType newTopGap) noexcept |
| Changes the top gap. | |
| void | setLeft (ValueType newLeftGap) noexcept |
| Changes the left gap. | |
| void | setBottom (ValueType newBottomGap) noexcept |
| Changes the bottom gap. | |
| void | setRight (ValueType newRightGap) noexcept |
| Changes the right gap. | |
| Rectangle< ValueType > | subtractedFrom (const Rectangle< ValueType > &original) const noexcept |
| Returns a rectangle with these borders removed from it. | |
| void | subtractFrom (Rectangle< ValueType > &rectangle) const noexcept |
| Removes this border from a given rectangle. | |
| Rectangle< ValueType > | addedTo (const Rectangle< ValueType > &original) const noexcept |
| Returns a rectangle with these borders added around it. | |
| void | addTo (Rectangle< ValueType > &rectangle) const noexcept |
| Adds this border around a given rectangle. | |
| bool | operator== (const BorderSize &other) const noexcept |
| bool | operator!= (const BorderSize &other) const noexcept |
Specifies a set of gaps to be left around the sides of a rectangle.
This is basically the size of the spaces at the top, bottom, left and right of a rectangle. It's used by various component classes to specify borders.
| BorderSize< ValueType >::BorderSize | ( | ) |
Creates a null border.
All sizes are left as 0.
| BorderSize< ValueType >::BorderSize | ( | const BorderSize< ValueType > & | other ) |
Creates a copy of another border.
| BorderSize< ValueType >::BorderSize | ( | ValueType | topGap, |
| ValueType | leftGap, | ||
| ValueType | bottomGap, | ||
| ValueType | rightGap | ||
| ) |
Creates a border with the given gaps.
| BorderSize< ValueType >::BorderSize | ( | ValueType | allGaps ) | [explicit] |
Creates a border with the given gap on all sides.
| ValueType BorderSize< ValueType >::getTop | ( | ) | const |
Returns the gap that should be left at the top of the region.
| ValueType BorderSize< ValueType >::getLeft | ( | ) | const |
Returns the gap that should be left at the top of the region.
| ValueType BorderSize< ValueType >::getBottom | ( | ) | const |
Returns the gap that should be left at the top of the region.
| ValueType BorderSize< ValueType >::getRight | ( | ) | const |
Returns the gap that should be left at the top of the region.
| ValueType BorderSize< ValueType >::getTopAndBottom | ( | ) | const |
Returns the sum of the top and bottom gaps.
| ValueType BorderSize< ValueType >::getLeftAndRight | ( | ) | const |
Returns the sum of the left and right gaps.
| bool BorderSize< ValueType >::isEmpty | ( | ) | const |
Returns true if this border has no thickness along any edge.
| void BorderSize< ValueType >::setTop | ( | ValueType | newTopGap ) |
Changes the top gap.
| void BorderSize< ValueType >::setLeft | ( | ValueType | newLeftGap ) |
Changes the left gap.
| void BorderSize< ValueType >::setBottom | ( | ValueType | newBottomGap ) |
Changes the bottom gap.
| void BorderSize< ValueType >::setRight | ( | ValueType | newRightGap ) |
Changes the right gap.
| Rectangle<ValueType> BorderSize< ValueType >::subtractedFrom | ( | const Rectangle< ValueType > & | original ) | const |
Returns a rectangle with these borders removed from it.
Referenced by BorderSize< int >::subtractFrom().
| void BorderSize< ValueType >::subtractFrom | ( | Rectangle< ValueType > & | rectangle ) | const |
Removes this border from a given rectangle.
| Rectangle<ValueType> BorderSize< ValueType >::addedTo | ( | const Rectangle< ValueType > & | original ) | const |
Returns a rectangle with these borders added around it.
Referenced by BorderSize< int >::addTo().
| void BorderSize< ValueType >::addTo | ( | Rectangle< ValueType > & | rectangle ) | const |
Adds this border around a given rectangle.
| bool BorderSize< ValueType >::operator== | ( | const BorderSize< ValueType > & | other ) | const |
Referenced by BorderSize< int >::operator!=().
| bool BorderSize< ValueType >::operator!= | ( | const BorderSize< ValueType > & | other ) | const |