|
iPlug2 - C++ Audio Plug-in Framework
|
Used to manage a rectangular area, independent of draw class/platform. More...
#include <IGraphicsStructs.h>
Public Member Functions | |
| IRECT () | |
| Construct an empty IRECT More... | |
| IRECT (float l, float t, float r, float b) | |
| Construct a new IRECT with dimensions. More... | |
| IRECT (float x, float y, const IBitmap &bitmap) | |
| Construct a new IRECT at the given position and with the same size as the bitmap. More... | |
| bool | Empty () const |
| void | Clear () |
| Set all fields of this IRECT to 0. More... | |
| bool | operator== (const IRECT &rhs) const |
| bool | operator!= (const IRECT &rhs) const |
| float | W () const |
| float | H () const |
| float | MW () const |
| float | MH () const |
| float | Area () const |
| IRECT | Union (const IRECT &rhs) const |
Create a new IRECT that is a union of this IRECT and rhs. More... | |
| IRECT | Intersect (const IRECT &rhs) const |
Create a new IRECT that is the intersection of this IRECT and rhs. More... | |
| bool | Intersects (const IRECT &rhs) const |
Returns true if this IRECT shares any common pixels with rhs, false otherwise. More... | |
| bool | Contains (const IRECT &rhs) const |
Returns true if this IRECT completely contains rhs. More... | |
| bool | Contains (float x, float y) const |
| Returns true if this IRECT completely contains the point (x,y). More... | |
| bool | ContainsEdge (float x, float y) const |
| Returns true if the point (x,y) is either contained in this IRECT or on an edge. More... | |
| void | Constrain (float &x, float &y) const |
| Ensure the point (x,y) is inside this IRECT. More... | |
| IRECT | Inset (const IRECT &rhs) const |
| Offsets the input IRECT based on the parent. More... | |
| bool | Mergeable (const IRECT &rhs) const |
Return if this IRECT and rhs may be merged. More... | |
| IRECT | FracRect (EDirection layoutDir, float frac, bool fromTopOrRight=false) const |
| Get a new rectangle which is a fraction of this rectangle. More... | |
| IRECT | FracRectHorizontal (float frac, bool rhs=false) const |
Returns a new IRECT with a width that is multiplied by frac. More... | |
| IRECT | FracRectVertical (float frac, bool fromTop=false) const |
Returns a new IRECT with a height that is multiplied by frac. More... | |
| IRECT | SubRectVertical (int numSlices, int sliceIdx) const |
| Returns a new IRECT which is a horizontal "slice" of this IRECT. More... | |
| IRECT | SubRectHorizontal (int numSlices, int sliceIdx) const |
| Returns a new IRECT which is a vertical "slice" of this IRECT. More... | |
| IRECT | SubRect (EDirection layoutDir, int numSlices, int sliceIdx) const |
| Get a new rectangle which is a "slice" of this rectangle. More... | |
| IRECT | GetFromTLHC (float w, float h) const |
| Get a subrect of this IRECT expanding from the top-left corner. More... | |
| IRECT | GetFromBLHC (float w, float h) const |
| Get a subrect of this IRECT expanding from the bottom-left corner. More... | |
| IRECT | GetFromTRHC (float w, float h) const |
| Get a subrect of this IRECT expanding from the top-right corner. More... | |
| IRECT | GetFromBRHC (float w, float h) const |
| Get a subrect of this IRECT expanding from the bottom-right corner. More... | |
| IRECT | GetFromTop (float amount) const |
| Get a subrect of this IRECT bounded in Y by the top edge and 'amount'. More... | |
| IRECT | GetFromBottom (float amount) const |
| Get a subrect of this IRECT bounded in Y by 'amount' and the bottom edge. More... | |
| IRECT | GetFromLeft (float amount) const |
| Get a subrect of this IRECT bounded in X by the left edge and 'amount'. More... | |
| IRECT | GetFromRight (float amount) const |
| Get a subrect of this IRECT bounded in X by 'amount' and the right edge. More... | |
| IRECT | GetReducedFromTop (float amount) const |
| Get a subrect of this IRECT reduced in height from the top edge by 'amount'. More... | |
| IRECT | GetReducedFromBottom (float amount) const |
| Get a subrect of this IRECT reduced in height from the bottom edge by 'amount'. More... | |
| IRECT | GetReducedFromLeft (float amount) const |
| Get a subrect of this IRECT reduced in width from the left edge by 'amount'. More... | |
| IRECT | GetReducedFromRight (float amount) const |
| Get a subrect of this IRECT reduced in width from the right edge by 'amount'. More... | |
| IRECT | ReduceFromTop (float amount) |
| Reduce in height from the top edge by 'amount' and return the removed region. More... | |
| IRECT | ReduceFromBottom (float amount) |
| Reduce in height from the bottom edge by 'amount' and return the removed region. More... | |
| IRECT | ReduceFromLeft (float amount) |
| Reduce in width from the left edge by 'amount' and return the removed region. More... | |
| IRECT | ReduceFromRight (float amount) |
| Reduce in width from the right edge by 'amount' and return the removed region. More... | |
| IRECT | GetGridCell (int row, int col, int nRows, int nColumns) const |
| Get a subrect (by row, column) of this IRECT which is a cell in a grid of size (nRows * nColumns) More... | |
| IRECT | GetGridCell (int cellIndex, int nRows, int nColumns, EDirection dir=EDirection::Horizontal, int nCells=1) const |
| Get a subrect (by index) of this IRECT which is a cell (or union of nCells sequential cells on same row/column) in a grid of size (nRows * nColumns) More... | |
| bool | IsPixelAligned () const |
| bool | IsPixelAligned (float scale) const |
Return true if, when scaled by scale, this IRECT is pixel aligned When scaling this mutliples each value of the IRECT, it does not scale from the center. More... | |
| void | PixelAlign () |
| Pixel aligns the rect in an inclusive manner (moves all points outwards) More... | |
| void | PixelAlign (float scale) |
| Pixel-align this IRECT at the given scale factor then scale it back down When scaling this mutliples each value of the IRECT, it does not scale from the center. More... | |
| IRECT | GetPixelAligned () const |
| Get a copy of this IRECT with PixelAlign() called. More... | |
| IRECT | GetPixelAligned (float scale) const |
| Get a copy of this IRECT with PixelAlign(scale) called. More... | |
| void | PixelSnap () |
| Pixel aligns to nearest pixels This may make the IRECT smaller, unlike PixelAlign(). More... | |
| void | PixelSnap (float scale) |
| Pixel align a scaled version of this IRECT. More... | |
| IRECT | GetPixelSnapped () const |
| IRECT | GetPixelSnapped (float scale) const |
| Get a copy of this IRECT with PixelSnap(scale) called. More... | |
| void | Pad (float padding) |
| Pad this IRECT N.B. More... | |
| void | Pad (float padL, float padT, float padR, float padB) |
| Pad this IRECT N.B. More... | |
| void | HPad (float padding) |
| Pad this IRECT in the X-axis N.B. More... | |
| void | VPad (float padding) |
| Pad this IRECT in the Y-axis N.B. More... | |
| void | MidHPad (float padding) |
| Set the width of this IRECT to 2*padding without changing it's center point on the X-axis. More... | |
| void | MidVPad (float padding) |
| Set the height of this IRECT to 2*padding without changing it's center point on the Y-axis. More... | |
| IRECT | GetPadded (float padding) const |
Get a copy of this IRECT with each value padded by padding N.B. More... | |
| IRECT | GetPadded (float padL, float padT, float padR, float padB) const |
| Get a copy of this IRECT with the values padded N.B. More... | |
| IRECT | GetHPadded (float padding) const |
| Get a copy of this IRECT padded in the X-axis N.B. More... | |
| IRECT | GetVPadded (float padding) const |
| Get a copy of this IRECT padded in the Y-axis N.B. More... | |
| IRECT | GetMidHPadded (float padding) const |
| Get a copy of this IRECT where its width = 2 * padding but the center point on the X-axis has not changed. More... | |
| IRECT | GetMidVPadded (float padding) const |
| Get a copy of this IRECT where its height = 2 * padding but the center point on the Y-axis has not changed. More... | |
| IRECT | GetHSliced (float w, bool rhs=false) const |
| Get a copy of this IRECT with a new width. More... | |
| IRECT | GetVSliced (float h, bool bot=false) const |
| Get a copy of this IRECT with a new height. More... | |
| void | Clank (const IRECT &rhs) |
| Clank will limit this IRECT's bounds based on the boundaries of the IRECT passed in as an argument. More... | |
| void | Scale (float scale) |
Multiply each field of this IRECT by scale. More... | |
| void | ScaleAboutCentre (float scale) |
Scale the width and height of this IRECT by scale without changing the center point. More... | |
| IRECT | GetScaled (float scale) const |
Get a copy of this IRECT with all values multiplied by scale. More... | |
| IRECT | GetScaledAboutCentre (float scale) const |
Get a copy of this IRECT where the width and height are multiplied by scale without changing the center point. More... | |
| void | GetRandomPoint (float &x, float &y) const |
| Get a random point within this rectangle. More... | |
| IRECT | GetRandomSubRect () const |
| void | Offset (float l, float t, float r, float b) |
| Offset each field of the rectangle. More... | |
| IRECT | GetOffset (float l, float t, float r, float b) const |
| Get a copy of this rectangle where each field is offset by a specified amount. More... | |
| void | Translate (float x, float y) |
| Translate this rectangle. More... | |
| IRECT | GetTranslated (float x, float y) const |
| Get a translated copy of this rectangle. More... | |
| IRECT | GetHShifted (float x) const |
| Get a copy of this rectangle translated on the X axis. More... | |
| IRECT | GetVShifted (float y) const |
| Get a copy of this rectangle translated on the Y axis. More... | |
| IRECT | GetCentredInside (const IRECT &sr) const |
Get a rectangle the size of sr but with the same center point as this rectangle. More... | |
| IRECT | GetCentredInside (float w, float h=0.f) const |
| Get a rectangle with the same center point as this rectangle and the given size. More... | |
| IRECT | GetCentredInside (const IBitmap &bitmap) const |
| Get a rectangle with the same center point as this rectangle and the size of the bitmap. More... | |
| void | VAlignTo (const IRECT &sr, EVAlign align) |
| Vertically align this rect to the reference IRECT. More... | |
| void | HAlignTo (const IRECT &sr, EAlign align) |
| Horizontally align this rect to the reference IRECT. More... | |
| IRECT | GetVAlignedTo (const IRECT &sr, EVAlign align) const |
| Get a rectangle the same dimensions as this one, vertically aligned to the reference IRECT. More... | |
| float | GetLengthOfShortestSide () const |
| IRECT | GetHAlignedTo (const IRECT &sr, EAlign align) const |
| Get a rectangle the same dimensions as this one, horizontally aligned to the reference IRECT. More... | |
| void | DBGPrint () |
| Print the IRECT's details to the console in Debug builds. More... | |
Static Public Member Functions | |
| static IRECT | MakeXYWH (float l, float t, float w, float h) |
| Create a new IRECT with the given position and size. More... | |
| static IRECT | MakeMidXYWH (float x, float y, float w, float h) |
| Create a new IRECT of size (y,h) centred at the given position (x,y) More... | |
| static IRECT | LinearInterpolateBetween (const IRECT &start, const IRECT &dest, float progress) |
Get a rectangle that is a linear interpolation between start and dest More... | |
Public Attributes | |
| float | L |
| float | T |
| float | R |
| float | B |
Used to manage a rectangular area, independent of draw class/platform.
An IRECT is always specified in 1:1 pixels, any scaling for high DPI happens in the drawing class. In IGraphics 0,0 is top left.
Definition at line 757 of file IGraphicsStructs.h.
|
inline |
Construct an empty IRECT
Definition at line 762 of file IGraphicsStructs.h.
Referenced by FracRectHorizontal(), FracRectVertical(), GetFromBLHC(), GetFromBottom(), GetFromBRHC(), GetFromLeft(), GetFromRight(), GetFromTLHC(), GetFromTop(), GetFromTRHC(), GetHPadded(), GetHSliced(), GetMidHPadded(), GetMidVPadded(), GetOffset(), GetPadded(), GetRandomSubRect(), GetReducedFromBottom(), GetReducedFromLeft(), GetReducedFromRight(), GetReducedFromTop(), GetTranslated(), GetVPadded(), GetVSliced(), Inset(), Intersect(), MakeMidXYWH(), MakeXYWH(), SubRectHorizontal(), SubRectVertical(), and Union().
|
inline |
Construct a new IRECT with dimensions.
| l | Left |
| t | Top |
| r | Right |
| b | Bottom |
Definition at line 772 of file IGraphicsStructs.h.
|
inline |
Construct a new IRECT at the given position and with the same size as the bitmap.
| x | Top |
| y | Left |
| bitmap | Bitmap for the size |
Definition at line 780 of file IGraphicsStructs.h.
References IBitmap::FH(), and IBitmap::FW().
|
inline |
Definition at line 845 of file IGraphicsStructs.h.
|
inline |
Clank will limit this IRECT's bounds based on the boundaries of the IRECT passed in as an argument.
| rhs | The rectangle to limit with |
Definition at line 1426 of file IGraphicsStructs.h.
Referenced by IGraphics::IsDirty().
|
inline |
Set all fields of this IRECT to 0.
Definition at line 817 of file IGraphicsStructs.h.
|
inline |
Ensure the point (x,y) is inside this IRECT.
| x | point X, will be modified if it's outside this IRECT |
| y | point Y, will be modified if it's outside this IRECT |
Definition at line 912 of file IGraphicsStructs.h.
Referenced by IVXYPadControl::OnMouseDrag(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseOver(), IControl::SnapToMouse(), and IVMultiSliderControl< MAXNC >::SnapToMouse().
|
inline |
Returns true if this IRECT completely contains rhs.
| rhs | another IRECT |
Definition at line 883 of file IGraphicsStructs.h.
References Empty().
Referenced by IRECTList::Find(), IControl::IsHit(), IVButtonControl::IsHit(), IVSwitchControl::IsHit(), IVKnobControl::IsHit(), IVSliderControl::IsHit(), IVNumberBoxControl::OnMouseDblClick(), IVKnobControl::OnMouseDown(), IVSliderControl::OnMouseDown(), IPopupMenuControl::OnMouseDown(), ITextEntryControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), IVKnobControl::OnMouseOver(), IVSliderControl::OnMouseOver(), IVRangeSliderControl::OnMouseOver(), IPopupMenuControl::OnMouseOver(), TestBezierControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), and IRECTList::Optimize().
|
inline |
|
inline |
Returns true if the point (x,y) is either contained in this IRECT or on an edge.
Unlike Contains(x,y) this method includes right-most and bottom-most pixels.
| x | point X |
| y | point Y |
Definition at line 904 of file IGraphicsStructs.h.
References Empty().
|
inline |
Print the IRECT's details to the console in Debug builds.
Definition at line 1700 of file IGraphicsStructs.h.
|
inline |
Definition at line 811 of file IGraphicsStructs.h.
Referenced by Contains(), ContainsEdge(), IGraphicsLiveEdit::Draw(), IVGroupControl::DrawWidget(), Intersects(), IVectorBase::MakeRects(), Mergeable(), IGraphics::PathClipRegion(), IGraphics::ShowFPSDisplay(), and Union().
|
inline |
Get a new rectangle which is a fraction of this rectangle.
| layoutDir | EDirection::Vertical or EDirection::Horizontal |
| frac | Fractional multiplier |
| fromTopOrRight | If true the new rectangle will expand from the top (Vertical) or right (Horizontal) otherwise it will expand from the bottom (Vertical) or left (Horizontal) |
Definition at line 948 of file IGraphicsStructs.h.
References FracRectHorizontal(), and FracRectVertical().
Referenced by IVSliderControl::DrawWidget().
|
inline |
Returns a new IRECT with a width that is multiplied by frac.
| frac | width multiplier |
| rhs | if true, the new IRECT will expand/contract from the right, otherwise it will come from the left |
Definition at line 960 of file IGraphicsStructs.h.
Referenced by IVColorSwatchControl::DrawWidget(), FracRect(), IRECTList::GetFracGrid(), and IGraphicsFaustUI::BoxControl::OnResize().
|
inline |
Returns a new IRECT with a height that is multiplied by frac.
| frac | height multiplier |
| fromTop | if true, the new IRECT will expand/contract from the top, otherwise it will come from the bottom |
Definition at line 974 of file IGraphicsStructs.h.
Referenced by IWheelControl::Draw(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), FracRect(), IRECTList::GetFracGrid(), IVNumberBoxControl::OnAttached(), IVNumberBoxControl::OnResize(), and IGraphicsFaustUI::BoxControl::OnResize().
Get a rectangle with the same center point as this rectangle and the size of the bitmap.
| bitmap | Bitmap used to size the new rectangle |
Definition at line 1629 of file IGraphicsStructs.h.
References IBitmap::FH(), IBitmap::FW(), MH(), and MW().
Get a rectangle the size of sr but with the same center point as this rectangle.
| sr | Size rectangle |
Definition at line 1595 of file IGraphicsStructs.h.
References H(), MH(), MW(), and W().
Referenced by IGraphicsFaustUI::DefaultControlBounds(), IBSliderControl::Draw(), ILEDControl::Draw(), TestBezierControl::Draw(), TestDrawContextControl::Draw(), TestFlexBoxControl::Draw(), TestFontControl::Draw(), TestMaskControl::Draw(), IBitmapBase::DrawBitmap(), IVRadioButtonControl::DrawWidget(), IVKnobControl::DrawWidget(), IVKnobControl::GetKnobDragBounds(), IVectorBase::MakeRects(), ISVGSliderControl::OnResize(), IBSliderControl::OnResize(), TestDirBrowseControl::OnResize(), TestPopupMenuControl::OnResize(), and ICaptionControl::OnResize().
|
inline |
Get a rectangle with the same center point as this rectangle and the given size.
| w | Width of the new rectangle (minimum 1.0) |
| h | Height of the new rectangle (a value of 0 will make it the same as w, thus a square) |
Definition at line 1610 of file IGraphicsStructs.h.
|
inline |
Get a subrect of this IRECT expanding from the bottom-left corner.
Definition at line 1037 of file IGraphicsStructs.h.
References IRECT().
Referenced by TestPopupMenuControl::OnResize().
|
inline |
Get a subrect of this IRECT bounded in Y by 'amount' and the bottom edge.
| amount | Size in Y of the desired IRECT |
Definition at line 1059 of file IGraphicsStructs.h.
References IRECT().
Referenced by IWheelControl::Draw(), TestFontControl::Draw(), IVectorBase::MakeRects(), TestDirBrowseControl::OnResize(), and ReduceFromBottom().
|
inline |
Get a subrect of this IRECT expanding from the bottom-right corner.
Definition at line 1049 of file IGraphicsStructs.h.
References IRECT().
Referenced by ICornerResizerControl::OnRescale(), and TestPopupMenuControl::OnResize().
|
inline |
Get a subrect of this IRECT bounded in X by the left edge and 'amount'.
| amount | Size in X of the desired IRECT |
Definition at line 1064 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVRadioButtonControl::DrawWidget(), IPopupMenuControl::GetCellTickBounds(), IVectorBase::MakeRects(), ICaptionControl::OnResize(), and ReduceFromLeft().
|
inline |
Get a subrect of this IRECT bounded in X by 'amount' and the right edge.
| amount | Size in X of the desired IRECT |
Definition at line 1069 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVRadioButtonControl::DrawWidget(), IPopupMenuControl::GetCellArrowBounds(), IVectorBase::MakeRects(), TestDirBrowseControl::OnResize(), ICaptionControl::OnResize(), and ReduceFromRight().
|
inline |
Get a subrect of this IRECT expanding from the top-left corner.
Definition at line 1031 of file IGraphicsStructs.h.
References IRECT().
Referenced by TestPopupMenuControl::OnResize(), and IGraphics::ShowFPSDisplay().
|
inline |
Get a subrect of this IRECT bounded in Y by the top edge and 'amount'.
| amount | Size in Y of the desired IRECT |
Definition at line 1054 of file IGraphicsStructs.h.
References IRECT().
Referenced by TestDragAndDropControl::Draw(), TestFontControl::Draw(), IVectorBase::MakeRects(), and ReduceFromTop().
|
inline |
Get a subrect of this IRECT expanding from the top-right corner.
Definition at line 1043 of file IGraphicsStructs.h.
References IRECT().
Referenced by TestPopupMenuControl::OnResize().
|
inline |
Get a subrect (by index) of this IRECT which is a cell (or union of nCells sequential cells on same row/column) in a grid of size (nRows * nColumns)
| cellIndex | Index of the desired cell in the cell grid |
| nRows | Number of rows in the cell grid |
| nColumns | Number of columns in the cell grid |
| dir | Desired direction of indexing, by row (EDirection::Horizontal) or by column (EDirection::Vertical) |
| nCells | Number of desired sequential cells to join (on same row/column) |
Definition at line 1132 of file IGraphicsStructs.h.
References SubRectHorizontal(), SubRectVertical(), and Union().
|
inline |
Get a subrect (by row, column) of this IRECT which is a cell in a grid of size (nRows * nColumns)
| row | Row index of the desired subrect |
| col | Column index of the desired subrect |
| nRows | Number of rows in the cell grid |
| nColumns | Number of columns in the cell grid |
Definition at line 1117 of file IGraphicsStructs.h.
References SubRectHorizontal(), and SubRectVertical().
Referenced by TestBlendControl::Draw(), IVColorSwatchControl::OnResize(), and TestPopupMenuControl::OnResize().
Get a rectangle the same dimensions as this one, horizontally aligned to the reference IRECT.
| sr | the IRECT to use as reference |
| align | the horizontal alignment |
Definition at line 1692 of file IGraphicsStructs.h.
References HAlignTo().
|
inline |
Get a copy of this IRECT padded in the X-axis N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Left and right padding |
Definition at line 1370 of file IGraphicsStructs.h.
References IRECT().
Referenced by IPopupMenuControl::DrawCellText().
|
inline |
Get a copy of this rectangle translated on the X axis.
| x | Offset |
Definition at line 1579 of file IGraphicsStructs.h.
References GetTranslated().
Referenced by IGraphicsFaustUI::BoxControl::OnResize().
|
inline |
Get a copy of this IRECT with a new width.
| w | Width of the new rectangle |
| rhs | If true the new rectangle will expand from the right side, otherwise it will expand from the left |
Definition at line 1404 of file IGraphicsStructs.h.
References IRECT().
|
inline |
Definition at line 1680 of file IGraphicsStructs.h.
|
inline |
Get a copy of this IRECT where its width = 2 * padding but the center point on the X-axis has not changed.
| padding | Left and right padding (1/2 the new width) |
Definition at line 1387 of file IGraphicsStructs.h.
Referenced by IVectorBase::MakeRects(), IVSliderControl::OnResize(), and IBSliderControl::OnResize().
|
inline |
Get a copy of this IRECT where its height = 2 * padding but the center point on the Y-axis has not changed.
| padding | Top and bottom padding (1/2 the new height) |
Definition at line 1395 of file IGraphicsStructs.h.
Referenced by IWheelControl::Draw(), IVectorBase::MakeRects(), IVSliderControl::OnResize(), and IBSliderControl::OnResize().
|
inline |
Get a copy of this rectangle where each field is offset by a specified amount.
| l | Left offset |
| t | Top offset |
| r | Right offset |
| b | Bottom offset |
Definition at line 1551 of file IGraphicsStructs.h.
References IRECT().
|
inline |
Get a copy of this IRECT with each value padded by padding N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Padding amount |
Definition at line 1349 of file IGraphicsStructs.h.
References IRECT().
Referenced by IBubbleControl::Draw(), IFPSDisplayControl::Draw(), IWheelControl::Draw(), IVNumberBoxControl::Draw(), TestArcControl::Draw(), TestBlendControl::Draw(), TestDirBrowseControl::Draw(), TestGradientControl::Draw(), TestLayerControl::Draw(), TestMultiPathControl::Draw(), TestPolyControl::Draw(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVXYPadControl::DrawWidget(), IVGroupControl::DrawWidget(), IVColorSwatchControl::DrawWidget(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IPopupMenuControl::GetCellTextBounds(), IGraphics::IsDirty(), IVNumberBoxControl::OnAttached(), IVSliderControl::OnResize(), IVColorSwatchControl::OnResize(), ISVGSliderControl::OnResize(), IVDisplayControl::OnResize(), IVNumberBoxControl::OnResize(), TestDirBrowseControl::OnResize(), TestPopupMenuControl::OnResize(), IVGroupControl::SetBoundsBasedOnGroup(), and IGraphics::ShowFPSDisplay().
|
inline |
Get a copy of this IRECT with the values padded N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padL | Left-padding |
| padT | Top-padding |
| padR | Right-padding |
| padB | Bottom-padding |
Definition at line 1361 of file IGraphicsStructs.h.
References IRECT().
|
inline |
Get a copy of this IRECT with PixelAlign() called.
Definition at line 1229 of file IGraphicsStructs.h.
References PixelAlign().
Referenced by IGraphics::StartLayer().
|
inline |
Get a copy of this IRECT with PixelAlign(scale) called.
| scale | Scaling factor for the alignment |
Definition at line 1239 of file IGraphicsStructs.h.
References PixelAlign().
|
inline |
Definition at line 1267 of file IGraphicsStructs.h.
References PixelSnap().
Referenced by IGraphics::GetPixelSnapped().
|
inline |
Get a copy of this IRECT with PixelSnap(scale) called.
| Scaling | factor for the alignment |
Definition at line 1277 of file IGraphicsStructs.h.
References PixelSnap().
|
inline |
Get a random point within this rectangle.
| x | OUT output X value of point |
| y | OUT output Y value of point |
Definition at line 1512 of file IGraphicsStructs.h.
Referenced by GetRandomSubRect().
|
inline |
Definition at line 1522 of file IGraphicsStructs.h.
References GetRandomPoint(), and IRECT().
Referenced by TestAnimationControl::OnMouseDown().
|
inline |
Get a subrect of this IRECT reduced in height from the bottom edge by 'amount'.
| amount | Size in Y to reduce by |
Definition at line 1079 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVectorBase::MakeRects().
|
inline |
Get a subrect of this IRECT reduced in width from the left edge by 'amount'.
| amount | Size in X to reduce by |
Definition at line 1084 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVectorBase::MakeRects().
|
inline |
Get a subrect of this IRECT reduced in width from the right edge by 'amount'.
| amount | Size in X to reduce by |
Definition at line 1089 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVectorBase::MakeRects().
|
inline |
Get a subrect of this IRECT reduced in height from the top edge by 'amount'.
| amount | Size in Y to reduce by |
Definition at line 1074 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVectorBase::MakeRects().
|
inline |
Get a copy of this IRECT with all values multiplied by scale.
| scale | The amount to multiply each value by |
Definition at line 1477 of file IGraphicsStructs.h.
References Scale().
|
inline |
Get a copy of this IRECT where the width and height are multiplied by scale without changing the center point.
| scale | Scaling factor |
Definition at line 1487 of file IGraphicsStructs.h.
References ScaleAboutCentre().
Referenced by ILEDControl::Draw(), and IVectorBase::MakeRects().
|
inline |
Get a translated copy of this rectangle.
| x | Offset in the X axis |
| y | Offset in the Y axis |
Definition at line 1571 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVLabelControl::Draw(), IWheelControl::Draw(), PlaceHolder::Draw(), IGraphicsSkia::DrawFastDropShadow(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVectorBase::DrawPressableTriangle(), IRECTList::GetFracGrid(), GetHShifted(), and GetVShifted().
Get a rectangle the same dimensions as this one, vertically aligned to the reference IRECT.
| sr | the source IRECT to use as reference |
| align | the vertical alignment |
Definition at line 1672 of file IGraphicsStructs.h.
References VAlignTo().
|
inline |
Get a copy of this IRECT padded in the Y-axis N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Top and bottom padding |
Definition at line 1379 of file IGraphicsStructs.h.
References IRECT().
Referenced by IVPlotControl::Draw(), ITextEntryControl::Draw(), and IVGroupControl::SetBoundsBasedOnGroup().
|
inline |
Get a copy of this rectangle translated on the Y axis.
| y | Offset |
Definition at line 1587 of file IGraphicsStructs.h.
References GetTranslated().
Referenced by TestPopupMenuControl::OnResize(), and IGraphicsFaustUI::BoxControl::OnResize().
|
inline |
Get a copy of this IRECT with a new height.
| h | Height of the new rectangle |
| bot | If true the new rectangle will expand from the bottom, otherwise it will expand from the top |
Definition at line 1416 of file IGraphicsStructs.h.
References IRECT().
|
inline |
Definition at line 836 of file IGraphicsStructs.h.
Referenced by Area(), DBGPrint(), IGraphicsFaustUI::DefaultControlBounds(), IColorPickerControl::Draw(), IVPlotControl::Draw(), ISVGKnobControl::Draw(), IFPSDisplayControl::Draw(), IVKeyboardControl::Draw(), IWheelControl::Draw(), ISkLottieControl::Draw(), TestDrawContextControl::Draw(), TestGradientControl::Draw(), TestLayerControl::Draw(), TestMultiPathControl::Draw(), TestShadowGradientControl::Draw(), IURLControl::Draw(), IGraphicsNanoVG::DrawBitmap(), IGraphics::DrawBitmapedText(), IGraphics::DrawData(), IGraphicsNanoVG::DrawDottedRect(), IGraphicsNanoVG::DrawFastDropShadow(), IGraphics::DrawFittedBitmap(), IGraphics::DrawFittedLayer(), IVectorBase::DrawLabel(), IGraphicsSkia::DrawMultiLineText(), IVectorBase::DrawPressableTriangle(), IGraphics::DrawSVG(), IVXYPadControl::DrawWidget(), IVDisplayControl::DrawWidget(), FracRectVertical(), GetCentredInside(), IRECTList::GetFracGrid(), IVKnobControl::GetKnobDragBounds(), GetLengthOfShortestSide(), GetRandomPoint(), IVectorBase::GetRoundedCornerRadius(), IFlexBox::Init(), IVectorBase::MakeRects(), IPlatformViewControl::OnAttached(), IWebViewControl::OnAttached(), ICornerResizerControl::OnMouseDblClick(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IVXYPadControl::OnMouseDrag(), IShaderControl::OnMouseDrag(), IGraphicsLiveEdit::OnMouseDrag(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseOver(), IShaderControl::OnMouseUp(), IVGroupControl::OnResize(), ISVGSliderControl::OnResize(), TestSizeControl::OnResize(), PlaceHolder::OnResize(), IGraphicsFaustUI::BoxControl::OnResize(), IGraphics::PathEllipse(), IGraphics::PathRoundRect(), ScaleAboutCentre(), IVGroupControl::SetBoundsBasedOnGroup(), ITextControl::SetBoundsBasedOnStr(), IControl::SetPosition(), IControl::SnapToMouse(), IVMultiSliderControl< MAXNC >::SnapToMouse(), IGraphics::StartLayer(), SubRectVertical(), IMatrix::Transform(), and VAlignTo().
|
inline |
Horizontally align this rect to the reference IRECT.
| sr | the IRECT to use as reference |
| align | the horizontal alignment |
Definition at line 1657 of file IGraphicsStructs.h.
References W().
Referenced by GetHAlignedTo().
|
inline |
Pad this IRECT in the X-axis N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Left and right padding |
Definition at line 1312 of file IGraphicsStructs.h.
Referenced by IVGroupControl::OnResize().
Offsets the input IRECT based on the parent.
| rhs | IRECT to offset |
Definition at line 923 of file IGraphicsStructs.h.
References IRECT().
Create a new IRECT that is the intersection of this IRECT and rhs.
The resulting IRECT will have the maximum L and T values and minimum R and B values of the inputs.
| rhs | another IRECT |
Definition at line 862 of file IGraphicsStructs.h.
References Intersects(), and IRECT().
Referenced by IRECTList::GetFracGrid(), IRECTList::Optimize(), and IGraphics::PathClipRegion().
|
inline |
Returns true if this IRECT shares any common pixels with rhs, false otherwise.
| rhs | another IRECT |
rhs rhs are completely separate Definition at line 874 of file IGraphicsStructs.h.
References Empty().
Referenced by Intersect(), and IRECTList::Optimize().
|
inline |
Definition at line 1187 of file IGraphicsStructs.h.
Referenced by IsPixelAligned().
|
inline |
Return true if, when scaled by scale, this IRECT is pixel aligned When scaling this mutliples each value of the IRECT, it does not scale from the center.
| scale | Scale value for the test |
Definition at line 1200 of file IGraphicsStructs.h.
References IsPixelAligned(), and Scale().
|
inlinestatic |
Get a rectangle that is a linear interpolation between start and dest
| start | Starting rectangle |
| dest | Ending rectangle |
| progress | Interpolation point |
Definition at line 1499 of file IGraphicsStructs.h.
Referenced by IVSlideSwitchControl::IVSlideSwitchControl().
|
inlinestatic |
|
inlinestatic |
|
inline |
Return if this IRECT and rhs may be merged.
The two rects cover exactly the area returned by Union()
| rhs | another IRECT |
rhs or rhs wholly contains this IRECT Definition at line 933 of file IGraphicsStructs.h.
References Empty().
Referenced by IRECTList::Optimize().
|
inline |
Definition at line 842 of file IGraphicsStructs.h.
Referenced by IGraphics::CalculateTextRotation(), ISVGKnobControl::Draw(), IBKnobRotaterControl::Draw(), ILEDControl::Draw(), TestArcControl::Draw(), TestBezierControl::Draw(), TestDrawContextControl::Draw(), TestGesturesControl::Draw(), TestLayerControl::Draw(), TestMaskControl::Draw(), TestMultiPathControl::Draw(), TestPolyControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IPopupMenuControl::DrawCalloutArrow(), IPopupMenuControl::DrawDownArrow(), IGraphicsNanoVG::DrawMultiLineText(), IGraphics::DrawRotatedLayer(), IPopupMenuControl::DrawSeparator(), IPopupMenuControl::DrawSubMenuArrow(), IPopupMenuControl::DrawSubMenuCalloutArrow(), IPopupMenuControl::DrawTick(), IPopupMenuControl::DrawUpArrow(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), GetCentredInside(), GetMidVPadded(), MidVPad(), IControl::OnAccessibleAction(), ISVGSliderControl::OnResize(), TestColorControl::OnResize(), IGraphics::PathEllipse(), IControl::PromptUserInput(), ScaleAboutCentre(), ITextControl::SetBoundsBasedOnStr(), and ShowBubbleHorizontalActionFunc().
|
inline |
Set the width of this IRECT to 2*padding without changing it's center point on the X-axis.
| padding | Left and right padding (1/2 the new width) |
Definition at line 1329 of file IGraphicsStructs.h.
References MW().
|
inline |
Set the height of this IRECT to 2*padding without changing it's center point on the Y-axis.
| padding | Top and bottom padding (1/2 the new height) |
Definition at line 1338 of file IGraphicsStructs.h.
References MH().
|
inline |
Definition at line 839 of file IGraphicsStructs.h.
Referenced by IGraphics::CalculateTextRotation(), ISVGKnobControl::Draw(), IBKnobRotaterControl::Draw(), ILEDControl::Draw(), TestArcControl::Draw(), TestBezierControl::Draw(), TestDirBrowseControl::Draw(), TestDrawContextControl::Draw(), TestGesturesControl::Draw(), TestLayerControl::Draw(), TestMaskControl::Draw(), TestMultiPathControl::Draw(), TestPolyControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), PlaceHolder::Draw(), IPopupMenuControl::DrawCalloutArrow(), IPopupMenuControl::DrawDownArrow(), IGraphicsNanoVG::DrawMultiLineText(), IVectorBase::DrawPressableTriangle(), IGraphics::DrawRotatedLayer(), IPopupMenuControl::DrawSubMenuArrow(), IPopupMenuControl::DrawTick(), IPopupMenuControl::DrawUpArrow(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVGroupControl::DrawWidget(), GetCentredInside(), GetMidHPadded(), MidHPad(), IControl::OnAccessibleAction(), IGraphics::PathEllipse(), IControl::PromptUserInput(), ScaleAboutCentre(), ITextControl::SetBoundsBasedOnStr(), and ShowBubbleVerticalActionFunc().
|
inline |
Offset each field of the rectangle.
| l | Left offset |
| t | Top offset |
| r | Right offset |
| b | Bottom offset |
Definition at line 1537 of file IGraphicsStructs.h.
Referenced by IVectorBase::GetAdjustedHandleBounds(), and IVGroupControl::OnResize().
|
inline |
Definition at line 827 of file IGraphicsStructs.h.
|
inline |
Definition at line 822 of file IGraphicsStructs.h.
|
inline |
Pad this IRECT N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Padding amount |
Definition at line 1287 of file IGraphicsStructs.h.
Referenced by GFXLabelControl::Draw(), IVectorBase::GetAdjustedHandleBounds(), IVNumberBoxControl::OnAttached(), and IVNumberBoxControl::OnResize().
|
inline |
Pad this IRECT N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padL | Left-padding |
| padT | Top-padding |
| padR | Right-padding |
| padB | Bottom-padding |
Definition at line 1301 of file IGraphicsStructs.h.
|
inline |
Pixel aligns the rect in an inclusive manner (moves all points outwards)
Definition at line 1208 of file IGraphicsStructs.h.
Referenced by IGraphics::Draw(), GetPixelAligned(), IRECTList::PixelAlign(), and PixelAlign().
|
inline |
Pixel-align this IRECT at the given scale factor then scale it back down When scaling this mutliples each value of the IRECT, it does not scale from the center.
| scale | Scale value for the alignment |
Definition at line 1219 of file IGraphicsStructs.h.
References PixelAlign(), and Scale().
|
inline |
Pixel aligns to nearest pixels This may make the IRECT smaller, unlike PixelAlign().
Definition at line 1248 of file IGraphicsStructs.h.
Referenced by GetPixelSnapped(), and PixelSnap().
|
inline |
Pixel align a scaled version of this IRECT.
| scale | Scaling factor for the alignment |
Definition at line 1258 of file IGraphicsStructs.h.
References PixelSnap(), and Scale().
|
inline |
Reduce in height from the bottom edge by 'amount' and return the removed region.
| amount | Size in Y to reduce by |
Definition at line 1099 of file IGraphicsStructs.h.
References GetFromBottom().
Referenced by IVectorBase::DrawPressableEllipse(), and IVectorBase::DrawPressableRectangle().
|
inline |
Reduce in width from the left edge by 'amount' and return the removed region.
| amount | Size in X to reduce by |
Definition at line 1104 of file IGraphicsStructs.h.
References GetFromLeft().
Referenced by IVNumberBoxControl::OnAttached(), and IVNumberBoxControl::OnResize().
|
inline |
Reduce in width from the right edge by 'amount' and return the removed region.
| amount | Size in X to reduce by |
Definition at line 1109 of file IGraphicsStructs.h.
References GetFromRight().
Referenced by IVectorBase::DrawPressableEllipse(), and IVectorBase::DrawPressableRectangle().
|
inline |
Reduce in height from the top edge by 'amount' and return the removed region.
| amount | Size in Y to reduce by |
Definition at line 1094 of file IGraphicsStructs.h.
References GetFromTop().
|
inline |
Multiply each field of this IRECT by scale.
| scale | The amount to multiply each field by |
Definition at line 1452 of file IGraphicsStructs.h.
Referenced by GetScaled(), IsPixelAligned(), PixelAlign(), and PixelSnap().
|
inline |
Scale the width and height of this IRECT by scale without changing the center point.
| scale | The scaling factor |
Definition at line 1462 of file IGraphicsStructs.h.
References H(), MH(), MW(), and W().
Referenced by GetScaledAboutCentre().
|
inline |
Get a new rectangle which is a "slice" of this rectangle.
| layoutDir | EDirection::Vertical or EDirection::Horizontal |
| numSlices | Number of equal-sized parts to divide this IRECT into |
| sliceIdx | Which "slice" to return |
Definition at line 1019 of file IGraphicsStructs.h.
References SubRectHorizontal(), and SubRectVertical().
Referenced by IVTabSwitchControl::OnResize().
|
inline |
Returns a new IRECT which is a vertical "slice" of this IRECT.
First divide the current width into numSlices equal parts, then return the n'th "slice" where "n" is sliceIdx. The returned IRECT will have the same height as this IRECT.
| numSlices | number of equal-sized parts to divide this IRECT into |
| sliceIdx | which "slice" to select |
Definition at line 1006 of file IGraphicsStructs.h.
Referenced by GetGridCell(), and SubRect().
|
inline |
Returns a new IRECT which is a horizontal "slice" of this IRECT.
First divide the current height into numSlices equal parts, then return the n'th "slice" where "n" is sliceIdx. The returned IRECT will have the same width as this IRECT.
| numSlices | number of equal-sized parts to divide this IRECT into |
| sliceIdx | which "slice" to select |
Definition at line 991 of file IGraphicsStructs.h.
Referenced by GetGridCell(), and SubRect().
|
inline |
Translate this rectangle.
| x | Offset in the X axis |
| y | Offset in the Y axis |
Definition at line 1559 of file IGraphicsStructs.h.
Referenced by IGraphicsNanoVG::ApplyShadowMask(), IGraphics::DoMeasureTextRotation(), and IVGroupControl::OnResize().
Create a new IRECT that is a union of this IRECT and rhs.
The resulting IRECT will have the minimim L and T values and maximum R and B values of the inputs.
| rhs | another IRECT |
Definition at line 851 of file IGraphicsStructs.h.
References Empty(), and IRECT().
Referenced by IRECTList::Bounds(), IGraphics::CalculateTextRotation(), and GetGridCell().
|
inline |
Vertically align this rect to the reference IRECT.
| sr | the source IRECT to use as reference |
| align | the vertical alignment |
Definition at line 1643 of file IGraphicsStructs.h.
References H().
Referenced by GetVAlignedTo().
|
inline |
Pad this IRECT in the Y-axis N.B.
Using a positive padding value will expand the IRECT, a negative value will contract it
| padding | Top and bottom padding |
Definition at line 1321 of file IGraphicsStructs.h.
|
inline |
Definition at line 833 of file IGraphicsStructs.h.
Referenced by Area(), DBGPrint(), IGraphicsFaustUI::DefaultControlBounds(), IGraphicsNanoVG::DoMeasureText(), IGraphicsSkia::DoMeasureText(), IColorPickerControl::Draw(), IVPlotControl::Draw(), ISVGKnobControl::Draw(), IFPSDisplayControl::Draw(), ILEDControl::Draw(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw(), IVKeyboardControl::Draw(), IWheelControl::Draw(), ISkLottieControl::Draw(), TestArcControl::Draw(), TestDrawContextControl::Draw(), TestFontControl::Draw(), TestLayerControl::Draw(), TestMaskControl::Draw(), TestMultiPathControl::Draw(), TestPolyControl::Draw(), TestShadowGradientControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), IGraphicsNanoVG::DrawBitmap(), IGraphics::DrawBitmapedText(), IGraphics::DrawData(), IGraphicsNanoVG::DrawDottedRect(), IGraphicsNanoVG::DrawFastDropShadow(), IGraphics::DrawFittedBitmap(), IGraphics::DrawFittedLayer(), IGraphicsNanoVG::DrawMultiLineText(), IGraphicsSkia::DrawMultiLineText(), IVectorBase::DrawPressableTriangle(), IGraphics::DrawSVG(), IVRadioButtonControl::DrawWidget(), IVKnobControl::DrawWidget(), IVXYPadControl::DrawWidget(), IVDisplayControl::DrawWidget(), FracRectHorizontal(), GetCentredInside(), IRECTList::GetFracGrid(), IVKnobControl::GetKnobDragBounds(), GetLengthOfShortestSide(), GetRandomPoint(), IVectorBase::GetRoundedCornerRadius(), HAlignTo(), IFlexBox::Init(), IVectorBase::MakeRects(), IPlatformViewControl::OnAttached(), IVNumberBoxControl::OnAttached(), IWebViewControl::OnAttached(), ICornerResizerControl::OnMouseDblClick(), IVXYPadControl::OnMouseDrag(), IShaderControl::OnMouseDrag(), IGraphicsLiveEdit::OnMouseDrag(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseOver(), IShaderControl::OnMouseUp(), ISVGSliderControl::OnResize(), IVKeyboardControl::OnResize(), IVNumberBoxControl::OnResize(), TestDirBrowseControl::OnResize(), TestSizeControl::OnResize(), PlaceHolder::OnResize(), IGraphicsFaustUI::BoxControl::OnResize(), IGraphics::PathEllipse(), IGraphics::PathRoundRect(), ScaleAboutCentre(), ITextControl::SetBoundsBasedOnStr(), IControl::SetPosition(), IControl::SnapToMouse(), IVMultiSliderControl< MAXNC >::SnapToMouse(), IGraphics::StartLayer(), SubRectHorizontal(), and IMatrix::Transform().
| float IRECT::B |
Definition at line 759 of file IGraphicsStructs.h.
| float IRECT::L |
Definition at line 759 of file IGraphicsStructs.h.
| float IRECT::R |
Definition at line 759 of file IGraphicsStructs.h.
| float IRECT::T |
Definition at line 759 of file IGraphicsStructs.h.