mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added new methods Rectangle::withRightX() and withBottomY()
This commit is contained in:
parent
2c8b98b6e1
commit
a15d79d4fe
1 changed files with 6 additions and 0 deletions
|
|
@ -202,6 +202,12 @@ public:
|
|||
/** Returns a rectangle which has the same size and x-position as this one, but with a different y-position. */
|
||||
Rectangle withY (ValueType newY) const noexcept { return Rectangle (pos.x, newY, w, h); }
|
||||
|
||||
/** Returns a rectangle which has the same size and y-position as this one, but whose right-hand edge has the given position. */
|
||||
Rectangle withRightX (ValueType newRightX) const noexcept { return Rectangle (newRightX - w, pos.y, w, h); }
|
||||
|
||||
/** Returns a rectangle which has the same size and x-position as this one, but whose bottom edge has the given position. */
|
||||
Rectangle withBottomY (ValueType newBottomY) const noexcept { return Rectangle (pos.x, newBottomY - h, w, h); }
|
||||
|
||||
/** Returns a rectangle with the same size as this one, but a new position. */
|
||||
Rectangle withPosition (ValueType newX, ValueType newY) const noexcept { return Rectangle (newX, newY, w, h); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue