1
0
Fork 0
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:
reuk 2025-02-06 22:37:12 +00:00
parent 81d1c104db
commit 6ff5e57b62
No known key found for this signature in database
2 changed files with 15 additions and 1 deletions

View file

@ -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()))); }