mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Windows: Fixed an OpenGL scale issue in high-DPI plug-ins
This commit is contained in:
parent
e4af85e07b
commit
d77dae186d
1 changed files with 6 additions and 4 deletions
|
|
@ -296,15 +296,17 @@ public:
|
|||
{
|
||||
if (auto* peer = component.getPeer())
|
||||
{
|
||||
auto localBounds = component.getLocalBounds();
|
||||
auto displayScale = Desktop::getInstance().getDisplays().findDisplayForRect (component.getTopLevelComponent()->getScreenBounds()).scale;
|
||||
|
||||
auto newArea = peer->getComponent().getLocalArea (&component, localBounds).withZeroOrigin() * displayScale;
|
||||
|
||||
#if JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE
|
||||
auto newScale = getScaleFactorForWindow (nativeContext->getNativeHandle());
|
||||
#else
|
||||
auto newScale = Desktop::getInstance().getDisplays().findDisplayForRect (component.getTopLevelComponent()->getScreenBounds()).scale;
|
||||
auto newScale = displayScale;
|
||||
#endif
|
||||
|
||||
auto localBounds = component.getLocalBounds();
|
||||
auto newArea = peer->getComponent().getLocalArea (&component, localBounds).withZeroOrigin() * newScale;
|
||||
|
||||
if (scale != newScale || viewportArea != newArea)
|
||||
{
|
||||
scale = newScale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue