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. | |
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. | |
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) | |
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) |
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 detailes to the console in Debug builds. | |
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 | 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 |
Left side of the rectangle (X) | |
float | T |
Top of the rectangle (Y) | |
float | R |
Right side of the rectangle (X + W) | |
float | B |
Bottom of the rectangle (Y + H) | |
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 750 of file IGraphicsStructs.h.
|
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 834 of file IGraphicsStructs.h.
References IBitmap::H(), and IBitmap::W().
|
inline |
|
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 901 of file IGraphicsStructs.h.
Referenced by IVKeyboardControl::Draw(), IVXYPadControl::OnMouseDrag(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and IControl::SnapToMouse().
|
inline |
Returns true if this IRECT completely contains rhs
.
rhs | another IRECT |
Definition at line 872 of file IGraphicsStructs.h.
References B, Empty(), L, R, and T.
Referenced by IPopupMenuControl::CalculateMenuPanels(), IVKeyboardControl::Draw(), IVButtonControl::IsHit(), IVSwitchControl::IsHit(), IVKnobControl::IsHit(), IVSliderControl::IsHit(), IControl::IsHit(), IVNumberBoxControl::OnMouseDblClick(), ITextEntryControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), IVKnobControl::OnMouseDown(), IVSliderControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), TestBezierControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), IVKnobControl::OnMouseOver(), IVSliderControl::OnMouseOver(), IVRangeSliderControl::OnMouseOver(), and IGraphics::ReleaseMouseCapture().
|
inline |
Returns true if this IRECT completely contains the point (x,y).
x | point X |
y | point Y |
Definition at line 882 of file IGraphicsStructs.h.
|
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 893 of file IGraphicsStructs.h.
|
inline |
Definition at line 800 of file IGraphicsStructs.h.
Referenced by IPopupMenuControl::CalculateMenuPanels(), Contains(), IGraphicsLiveEdit::Draw(), IVGroupControl::DrawWidget(), Intersects(), Mergeable(), IGraphics::PathClipRegion(), IBubbleControl::SetStrokeColor(), 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 937 of file IGraphicsStructs.h.
Referenced by IVRangeSliderControl::Draw(), IVTrackControlBase::DrawBackground(), IVSliderControl::DrawWidget(), and IVRangeSliderControl::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 949 of file IGraphicsStructs.h.
References IBitmap::W().
Referenced by IVColorSwatchControl::DrawWidget(), IRECTList::GetFracGrid(), and ICaptionControl::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 963 of file IGraphicsStructs.h.
References IBitmap::H().
Referenced by IWheelControl::Draw(), IRECTList::GetFracGrid(), IVNumberBoxControl::OnAttached(), and IVNumberBoxControl::OnResize().
Get a rectangle the size of sr
but with the same center point as this rectangle.
sr | Size rectangle |
Definition at line 1584 of file IGraphicsStructs.h.
References B, H(), L, R, T, and W().
Referenced by TestMaskControl::Draw(), TestDrawContextControl::Draw(), TestBezierControl::Draw(), TestFontControl::Draw(), ILEDControl::Draw(), TestFlexBoxControl::Draw(), IBSliderControl::Draw(), IPopupMenuControl::DrawCellText(), IPopupMenuControl::DrawTick(), IVRadioButtonControl::DrawWidget(), IVKnobControl::DrawWidget(), IVKnobControl::GetKnobDragBounds(), TestDirBrowseControl::OnResize(), ISVGSliderControl::OnResize(), IBSliderControl::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 1599 of file IGraphicsStructs.h.
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 1618 of file IGraphicsStructs.h.
References B, IBitmap::FH(), IBitmap::FW(), L, R, and T.
|
inline |
|
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 1048 of file IGraphicsStructs.h.
Referenced by TestFontControl::Draw(), IWheelControl::Draw(), IVectorBase::MakeRects(), and TestDirBrowseControl::OnResize().
|
inline |
Get a subrect of this IRECT expanding from the bottom-right corner.
Definition at line 1038 of file IGraphicsStructs.h.
Referenced by ICornerResizerControl::OnRescale().
|
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 1053 of file IGraphicsStructs.h.
Referenced by IVRadioButtonControl::DrawWidget().
|
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 1058 of file IGraphicsStructs.h.
Referenced by IVRadioButtonControl::DrawWidget(), and TestDirBrowseControl::OnResize().
|
inline |
|
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 1043 of file IGraphicsStructs.h.
Referenced by TestFontControl::Draw(), and IVectorBase::MakeRects().
|
inline |
|
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 1106 of file IGraphicsStructs.h.
References SubRectHorizontal().
Referenced by TestBlendControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), and IVColorSwatchControl::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 1121 of file IGraphicsStructs.h.
References SubRectHorizontal(), SubRectVertical(), and Union().
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 1681 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 1359 of file IGraphicsStructs.h.
Referenced by IVSliderControl::Draw(), and IPopupMenuControl::DrawCellBackground().
|
inline |
Get a copy of this rectangle translated on the X axis.
x | Offset |
Definition at line 1568 of file IGraphicsStructs.h.
|
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 1393 of file IGraphicsStructs.h.
|
inline |
Definition at line 1669 of file IGraphicsStructs.h.
References IBitmap::H(), and IBitmap::W().
|
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 1376 of file IGraphicsStructs.h.
Referenced by IVRangeSliderControl::Draw(), 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 1384 of file IGraphicsStructs.h.
Referenced by IVRangeSliderControl::Draw(), 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 1540 of file IGraphicsStructs.h.
|
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 1338 of file IGraphicsStructs.h.
Referenced by IGraphics::BeginFrame(), IPopupMenuControl::CalculateMenuPanels(), TestLayerControl::Draw(), TestPolyControl::Draw(), TestMultiPathControl::Draw(), TestGradientControl::Draw(), TestArcControl::Draw(), TestBlendControl::Draw(), TestDirBrowseControl::Draw(), IFPSDisplayControl::Draw(), IBubbleControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVKeyboardControl::Draw(), IVRangeSliderControl::Draw(), IWheelControl::Draw(), IPopupMenuControl::DrawPanelShadow(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IVXYPadControl::DrawWidget(), IVGroupControl::DrawWidget(), IVColorSwatchControl::DrawWidget(), IGraphics::IsDirty(), IVBakedPresetManagerControl::OnAttached(), IVDiskPresetManagerControl::OnAttached(), TestDirBrowseControl::OnResize(), IVDisplayControl::OnResize(), IVSliderControl::OnResize(), IVGroupControl::OnResize(), IVColorSwatchControl::OnResize(), and ISVGSliderControl::OnResize().
|
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 1350 of file IGraphicsStructs.h.
|
inline |
Get a copy of this IRECT with PixelAlign() called.
Definition at line 1218 of file IGraphicsStructs.h.
References PixelAlign().
Referenced by IGraphics::BeginFrame(), and IGraphics::StartLayer().
|
inline |
Get a copy of this IRECT with PixelAlign(scale) called.
scale | Scaling factor for the alignment |
Definition at line 1228 of file IGraphicsStructs.h.
References PixelAlign().
|
inline |
Definition at line 1256 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 1266 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 1501 of file IGraphicsStructs.h.
References IBitmap::H(), and IBitmap::W().
Referenced by GetRandomSubRect().
|
inline |
Definition at line 1511 of file IGraphicsStructs.h.
References GetRandomPoint().
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 1068 of file IGraphicsStructs.h.
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 1073 of file IGraphicsStructs.h.
|
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 1078 of file IGraphicsStructs.h.
|
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 1063 of file IGraphicsStructs.h.
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 1466 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 1476 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 1560 of file IGraphicsStructs.h.
Referenced by IVLabelControl::Draw(), IWheelControl::Draw(), PlaceHolder::Draw(), IGraphicsSkia::DrawFastDropShadow(), IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), IVectorBase::DrawPressableTriangle(), and IRECTList::GetFracGrid().
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 1661 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 1368 of file IGraphicsStructs.h.
Referenced by ITextEntryControl::Draw(), IVSliderControl::Draw(), IVPlotControl::Draw(), and IVGroupControl::OnResize().
|
inline |
Get a copy of this rectangle translated on the Y axis.
y | Offset |
Definition at line 1576 of file IGraphicsStructs.h.
|
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 1405 of file IGraphicsStructs.h.
|
inline |
Definition at line 825 of file IGraphicsStructs.h.
Referenced by IGraphics::BeginFrame(), IPopupMenuControl::CreatePopupMenu(), IGraphicsCanvas::DoDrawText(), TestDrawContextControl::Draw(), TestLayerControl::Draw(), TestShadowGradientControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), IColorPickerControl::Draw(), ISkLottieControl::Draw(), IFPSDisplayControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVKeyboardControl::Draw(), IVPlotControl::Draw(), ISVGKnobControl::Draw(), IWheelControl::Draw(), IURLControl::Draw(), IVTrackControlBase::DrawBackground(), IGraphicsCanvas::DrawBitmap(), IGraphicsNanoVG::DrawBitmap(), IGraphics::DrawBitmapedText(), IPopupMenuControl::DrawCalloutArrow(), IGraphics::DrawData(), IGraphicsNanoVG::DrawDottedRect(), IPopupMenuControl::DrawDownArrow(), IGraphicsNanoVG::DrawFastDropShadow(), IGraphics::DrawFittedBitmap(), IGraphics::DrawFittedLayer(), IVectorBase::DrawPressableTriangle(), IPopupMenuControl::DrawSubMenuArrow(), IPopupMenuControl::DrawSubMenuCalloutArrow(), IGraphics::DrawSVG(), IPopupMenuControl::DrawUpArrow(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IVDisplayControl::DrawWidget(), IVKnobControl::DrawWidget(), IVXYPadControl::DrawWidget(), GetCentredInside(), IRECTList::GetFracGrid(), IVKnobControl::GetKnobDragBounds(), IVectorBase::GetRoundedCornerRadius(), IFlexBox::Init(), IGraphicsNanoVG::LoadAPIFont(), IVectorBase::MakeRects(), IWebViewControl::OnAttached(), ITextEntryControl::OnKeyDown(), ICornerResizerControl::OnMouseDblClick(), IShaderControl::OnMouseDown(), IVMultiSliderControl< MAXNC >::OnMouseDown(), IShaderControl::OnMouseDrag(), IGraphicsLiveEdit::OnMouseDrag(), IVXYPadControl::OnMouseDrag(), IShaderControl::OnMouseUp(), IWebViewControl::OnRescale(), TestSizeControl::OnResize(), IWebViewControl::OnResize(), IShaderControl::OnResize(), IVGroupControl::OnResize(), ISVGSliderControl::OnResize(), PlaceHolder::OnResize(), IGraphics::PathEllipse(), IGraphics::PathRoundRect(), ITextControl::SetBoundsBasedOnStr(), IControl::SetPosition(), IBubbleControl::SetStrokeColor(), IVMultiSliderControl< MAXNC >::SnapToMouse(), IControl::SnapToMouse(), IGraphics::StartLayer(), 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 1646 of file IGraphicsStructs.h.
References L, R, IBitmap::W(), and 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 1301 of file IGraphicsStructs.h.
Referenced by IPopupMenuControl::CreatePopupMenu(), IVGroupControl::OnResize(), and IBubbleControl::SetStrokeColor().
Offsets the input IRECT based on the parent.
rhs | IRECT to offset |
Definition at line 912 of file IGraphicsStructs.h.
Referenced by TestFlexBoxControl::OnResize().
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 851 of file IGraphicsStructs.h.
Referenced by IGraphics::BeginFrame(), IRECTList::GetFracGrid(), IRECTList::Optimize(), and IGraphics::PathClipRegion().
|
inline |
|
inline |
Definition at line 1176 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 1189 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 1488 of file IGraphicsStructs.h.
Referenced by IVToggleControl::DrawValue().
|
inlinestatic |
Create a new IRECT with the given position and size.
Definition at line 794 of file IGraphicsStructs.h.
Referenced by IBSwitchControl::OnMouseDown().
|
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 922 of file IGraphicsStructs.h.
|
inline |
Definition at line 831 of file IGraphicsStructs.h.
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphics::CalculateTextRotation(), IPattern::CreateLinearGradient(), TestMaskControl::Draw(), TestLayerControl::Draw(), TestDrawContextControl::Draw(), TestPolyControl::Draw(), TestMultiPathControl::Draw(), TestArcControl::Draw(), TestGesturesControl::Draw(), TestBezierControl::Draw(), ILEDControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVRangeSliderControl::Draw(), ISVGKnobControl::Draw(), IBKnobRotaterControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IPopupMenuControl::DrawCalloutArrow(), IPopupMenuControl::DrawDownArrow(), IGraphics::DrawRotatedLayer(), IPopupMenuControl::DrawSubMenuArrow(), IPopupMenuControl::DrawSubMenuCalloutArrow(), IPopupMenuControl::DrawUpArrow(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IGraphicsNanoVG::GetPoint(), IGraphicsSkia::LoadAPIFont(), TestColorControl::OnResize(), TestGradientControl::OnResize(), ISVGSliderControl::OnResize(), IGraphics::PathEllipse(), IGraphicsCanvas::PathFill(), IControl::PromptUserInput(), ITextControl::SetBoundsBasedOnStr(), IBubbleControl::SetStrokeColor(), 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 1318 of file IGraphicsStructs.h.
|
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 1327 of file IGraphicsStructs.h.
|
inline |
Definition at line 828 of file IGraphicsStructs.h.
Referenced by IPopupMenuControl::CalculateMenuPanels(), IGraphics::CalculateTextRotation(), IPattern::CreateLinearGradient(), TestMaskControl::Draw(), TestDrawContextControl::Draw(), TestLayerControl::Draw(), TestPolyControl::Draw(), TestMultiPathControl::Draw(), TestArcControl::Draw(), TestGesturesControl::Draw(), TestBezierControl::Draw(), TestDirBrowseControl::Draw(), ILEDControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVRangeSliderControl::Draw(), ISVGKnobControl::Draw(), IBKnobRotaterControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), PlaceHolder::Draw(), IPopupMenuControl::DrawCalloutArrow(), IPopupMenuControl::DrawDownArrow(), IVectorBase::DrawPressableTriangle(), IGraphics::DrawRotatedLayer(), IPopupMenuControl::DrawSubMenuCalloutArrow(), IPopupMenuControl::DrawUpArrow(), IVKnobControl::DrawWidget(), IVSliderControl::DrawWidget(), IVGroupControl::DrawWidget(), IGraphicsNanoVG::GetPoint(), IGraphicsSkia::LoadAPIFont(), ITextEntryControl::OnKeyDown(), TestGradientControl::OnResize(), IGraphics::PathEllipse(), IGraphicsCanvas::PathFill(), IControl::PromptUserInput(), ITextControl::SetBoundsBasedOnStr(), IBubbleControl::SetStrokeColor(), and ShowBubbleVerticalActionFunc().
|
inline |
Offset each field of the rectangle.
l | Left offset |
t | Top offset |
r | Right offset |
b | Bottom offset |
Definition at line 1526 of file IGraphicsStructs.h.
Referenced by IVectorBase::GetAdjustedHandleBounds(), and IVGroupControl::OnResize().
|
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 1276 of file IGraphicsStructs.h.
Referenced by IPopupMenuControl::CreatePopupMenu(), GFXLabelControl::Draw(), IVectorBase::GetAdjustedHandleBounds(), IVNumberBoxControl::OnAttached(), IVNumberBoxControl::OnResize(), and IBubbleControl::SetStrokeColor().
|
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 1290 of file IGraphicsStructs.h.
|
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 1208 of file IGraphicsStructs.h.
|
inline |
Pixel aligns to nearest pixels This may make the IRECT smaller, unlike PixelAlign().
Definition at line 1237 of file IGraphicsStructs.h.
Referenced by GetPixelSnapped().
|
inline |
Pixel align a scaled version of this IRECT.
scale | Scaling factor for the alignment |
Definition at line 1247 of file IGraphicsStructs.h.
|
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 1088 of file IGraphicsStructs.h.
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 1093 of file IGraphicsStructs.h.
Referenced by IVBakedPresetManagerControl::OnAttached(), IVNumberBoxControl::OnAttached(), IVDiskPresetManagerControl::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 1098 of file IGraphicsStructs.h.
Referenced by IVectorBase::DrawPressableEllipse(), IVectorBase::DrawPressableRectangle(), and IVDiskPresetManagerControl::OnAttached().
|
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 1083 of file IGraphicsStructs.h.
|
inline |
Multiply each field of this IRECT by scale
.
scale | The amount to multiply each field by |
Definition at line 1441 of file IGraphicsStructs.h.
Referenced by IGraphicsCanvas::DrawBitmap(), GetScaled(), and IsPixelAligned().
|
inline |
Scale the width and height of this IRECT by scale
without changing the center point.
scale | The scaling factor |
Definition at line 1451 of file IGraphicsStructs.h.
References IBitmap::H(), and IBitmap::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 1008 of file IGraphicsStructs.h.
Referenced by IVTrackControlBase::DrawTrackHandle(), IVToggleControl::DrawValue(), and 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 995 of file IGraphicsStructs.h.
References IBitmap::W().
Referenced by GetGridCell().
|
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 980 of file IGraphicsStructs.h.
References IBitmap::H().
Referenced by GetGridCell().
|
inline |
Translate this rectangle.
x | Offset in the X axis |
y | Offset in the Y axis |
Definition at line 1548 of file IGraphicsStructs.h.
Referenced by IGraphics::DoMeasureTextRotation(), IBSliderControl::Draw(), IVGroupControl::OnResize(), and IBubbleControl::SetStrokeColor().
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 840 of file IGraphicsStructs.h.
References B, Empty(), L, R, and T.
Referenced by IRECTList::Bounds(), IPopupMenuControl::CalculateMenuPanels(), IGraphics::CalculateTextRotation(), IPopupMenuControl::CreatePopupMenu(), GetGridCell(), IVGroupControl::OnResize(), and IBubbleControl::SetStrokeColor().
|
inline |
Vertically align this rect to the reference IRECT.
sr | the source IRECT to use as reference |
align | the vertical alignment |
Definition at line 1632 of file IGraphicsStructs.h.
References B, IBitmap::H(), H(), and T.
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 1310 of file IGraphicsStructs.h.
|
inline |
Definition at line 822 of file IGraphicsStructs.h.
Referenced by IGraphics::BeginFrame(), IPopupMenuControl::CalculateMenuPanels(), IPopupMenuControl::CreatePopupMenu(), IGraphicsCanvas::DoDrawText(), IGraphicsCanvas::DoMeasureText(), IGraphicsSkia::DoMeasureText(), IGraphicsNanoVG::DoMeasureText(), TestMaskControl::Draw(), TestDrawContextControl::Draw(), TestLayerControl::Draw(), TestPolyControl::Draw(), TestShadowGradientControl::Draw(), TestMultiPathControl::Draw(), TestArcControl::Draw(), TestFontControl::Draw(), IColorPickerControl::Draw(), ILEDControl::Draw(), ISkLottieControl::Draw(), IFPSDisplayControl::Draw(), IVLEDMeterControl< MAXNC >::Draw(), IVKeyboardControl::Draw(), IVPlotControl::Draw(), ISVGKnobControl::Draw(), IWheelControl::Draw(), IURLControl::Draw(), ICaptionControl::Draw(), IVTrackControlBase::DrawBackground(), IGraphicsCanvas::DrawBitmap(), IGraphicsNanoVG::DrawBitmap(), IGraphics::DrawBitmapedText(), IGraphics::DrawData(), IGraphicsNanoVG::DrawDottedRect(), IGraphicsNanoVG::DrawFastDropShadow(), IGraphics::DrawFittedBitmap(), IGraphics::DrawFittedLayer(), IVectorBase::DrawPressableTriangle(), IGraphics::DrawSVG(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IVDisplayControl::DrawWidget(), IVRadioButtonControl::DrawWidget(), IVKnobControl::DrawWidget(), IVXYPadControl::DrawWidget(), GetCentredInside(), IRECTList::GetFracGrid(), IVKnobControl::GetKnobDragBounds(), IVectorBase::GetRoundedCornerRadius(), HAlignTo(), IFlexBox::Init(), IGraphicsNanoVG::LoadAPIFont(), IVectorBase::MakeRects(), IWebViewControl::OnAttached(), IVNumberBoxControl::OnAttached(), ICornerResizerControl::OnMouseDblClick(), IShaderControl::OnMouseDown(), IShaderControl::OnMouseDrag(), IGraphicsLiveEdit::OnMouseDrag(), IVXYPadControl::OnMouseDrag(), IShaderControl::OnMouseUp(), IWebViewControl::OnRescale(), TestDirBrowseControl::OnResize(), TestSizeControl::OnResize(), TestGradientControl::OnResize(), IVNumberBoxControl::OnResize(), IWebViewControl::OnResize(), IShaderControl::OnResize(), IVKeyboardControl::OnResize(), ISVGSliderControl::OnResize(), PlaceHolder::OnResize(), IGraphics::PathEllipse(), IGraphics::PathRoundRect(), ITextControl::SetBoundsBasedOnStr(), IControl::SetPosition(), IBubbleControl::SetStrokeColor(), IVMultiSliderControl< MAXNC >::SnapToMouse(), IControl::SnapToMouse(), IGraphics::StartLayer(), and IMatrix::Transform().