1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AlertWindow: Scale window according to scale of associatedComponent

For DialogWindow, uses the scale of componentToCentreAround.

This allows drawing dialog windows at the expected scale in plugins.
An associated component must be supplied in order for this to work.
This commit is contained in:
reuk 2021-03-19 19:57:09 +00:00
parent 7b6d41be3f
commit 0f6f2728f2
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11
5 changed files with 26 additions and 10 deletions

View file

@ -291,7 +291,7 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
}
else
{
auto targetCentre = c->localPointToGlobal (c->getLocalBounds().getCentre());
auto targetCentre = c->localPointToGlobal (c->getLocalBounds().getCentre()) / getDesktopScaleFactor();
auto parentArea = c->getParentMonitorArea();
if (auto* parent = getParentComponent())