1
0
Fork 0
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:
reuk 2025-09-18 16:13:53 +01:00
parent 82cc2ab282
commit 0fab062726
No known key found for this signature in database

View file

@ -215,9 +215,8 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
return std::make_pair (globalTargetCentre, c->getParentMonitorArea() / scale); return std::make_pair (globalTargetCentre, c->getParentMonitorArea() / scale);
}(); }();
setBounds (Rectangle<int> (targetCentre.x - width / 2, setBounds (Rectangle { width, height }
targetCentre.y - height / 2, .withCentre (targetCentre)
width, height)
.constrainedWithin (parentArea.reduced (12, 12))); .constrainedWithin (parentArea.reduced (12, 12)));
} }
} }