mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix auxiliary desktop windows scaling and centring when Desktop::globalScaleFactor != 1.0
This commit is contained in:
parent
46a4dc95a1
commit
8d75a7a400
3 changed files with 5 additions and 3 deletions
|
|
@ -499,7 +499,7 @@ protected:
|
|||
/** @internal */
|
||||
int getDesktopWindowStyleFlags() const override;
|
||||
/** @internal */
|
||||
float getDesktopScaleFactor() const override { return desktopScale; }
|
||||
float getDesktopScaleFactor() const override { return desktopScale * Desktop::getInstance().getGlobalScaleFactor(); }
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ protected:
|
|||
/** @internal */
|
||||
bool keyPressed (const KeyPress&) override;
|
||||
/** @internal */
|
||||
float getDesktopScaleFactor() const override { return desktopScale; }
|
||||
float getDesktopScaleFactor() const override { return desktopScale * Desktop::getInstance().getGlobalScaleFactor(); }
|
||||
|
||||
private:
|
||||
std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override;
|
||||
|
|
|
|||
|
|
@ -298,7 +298,9 @@ void TopLevelWindow::centreAroundComponent (Component* c, const int width, const
|
|||
}
|
||||
else
|
||||
{
|
||||
auto targetCentre = c->localPointToGlobal (c->getLocalBounds().getCentre()) / getDesktopScaleFactor();
|
||||
const auto scale = getDesktopScaleFactor() / Desktop::getInstance().getGlobalScaleFactor();
|
||||
|
||||
auto targetCentre = c->localPointToGlobal (c->getLocalBounds().getCentre()) / scale;
|
||||
auto parentArea = c->getParentMonitorArea();
|
||||
|
||||
if (auto* parent = getParentComponent())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue