mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Component: Add overload for setTopRightPosition(Point<int>)
This commit is contained in:
parent
81d1c104db
commit
6ff5e57b62
2 changed files with 15 additions and 1 deletions
|
|
@ -928,7 +928,8 @@ void Component::setSize (int w, int h) { setBounds (getX(), get
|
|||
void Component::setTopLeftPosition (int x, int y) { setTopLeftPosition ({ x, y }); }
|
||||
void Component::setTopLeftPosition (Point<int> pos) { setBounds (pos.x, pos.y, getWidth(), getHeight()); }
|
||||
|
||||
void Component::setTopRightPosition (int x, int y) { setTopLeftPosition (x - getWidth(), y); }
|
||||
void Component::setTopRightPosition (int x, int y) { setTopRightPosition ({ x, y }); }
|
||||
void Component::setTopRightPosition (Point<int> pos) { setTopLeftPosition (pos.x - getWidth(), pos.y); }
|
||||
void Component::setBounds (Rectangle<int> r) { setBounds (r.getX(), r.getY(), r.getWidth(), r.getHeight()); }
|
||||
|
||||
void Component::setCentrePosition (Point<int> p) { setBounds (getBounds().withCentre (p.transformedBy (getTransform().inverted()))); }
|
||||
|
|
|
|||
|
|
@ -464,6 +464,19 @@ public:
|
|||
*/
|
||||
void setTopRightPosition (int x, int y);
|
||||
|
||||
/** Moves the component to a new position.
|
||||
|
||||
Changes the position of the component's top-right corner (keeping it the same size).
|
||||
The position is relative to the top-left of the component's parent.
|
||||
|
||||
If the component actually moves, this method will make a synchronous call to moved().
|
||||
|
||||
Note that if you've used setTransform() to apply a transform, then the component's
|
||||
bounds will no longer be a direct reflection of the position at which it appears within
|
||||
its parent, as the transform will be applied to whatever bounds you set for it.
|
||||
*/
|
||||
void setTopRightPosition (Point<int>);
|
||||
|
||||
/** Changes the size of the component.
|
||||
|
||||
A synchronous call to resized() will occur if the size actually changes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue