mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
TopLevelWindow: Simplify setBounds() call
This commit is contained in:
parent
82cc2ab282
commit
0fab062726
1 changed files with 2 additions and 3 deletions
|
|
@ -215,9 +215,8 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
|
|||
return std::make_pair (globalTargetCentre, c->getParentMonitorArea() / scale);
|
||||
}();
|
||||
|
||||
setBounds (Rectangle<int> (targetCentre.x - width / 2,
|
||||
targetCentre.y - height / 2,
|
||||
width, height)
|
||||
setBounds (Rectangle { width, height }
|
||||
.withCentre (targetCentre)
|
||||
.constrainedWithin (parentArea.reduced (12, 12)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue