mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Replaced deprecated Displays methods
This commit is contained in:
parent
c21241549b
commit
b7e28541ca
30 changed files with 51 additions and 51 deletions
|
|
@ -334,7 +334,7 @@ private:
|
|||
| RectanglePlacement::doNotResize);
|
||||
|
||||
auto result = placement.appliedTo (area, Desktop::getInstance().getDisplays()
|
||||
.getMainDisplay().userArea.reduced (20));
|
||||
.getPrimaryDisplay()->userArea.reduced (20));
|
||||
dw->setBounds (result);
|
||||
|
||||
dw->setResizable (true, ! native);
|
||||
|
|
@ -355,7 +355,7 @@ private:
|
|||
| RectanglePlacement::doNotResize);
|
||||
|
||||
auto result = placement.appliedTo (area, Desktop::getInstance().getDisplays()
|
||||
.getMainDisplay().userArea.reduced (20));
|
||||
.getPrimaryDisplay()->userArea.reduced (20));
|
||||
balls->setBounds (result);
|
||||
|
||||
balls->setVisible (true);
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ private:
|
|||
};
|
||||
addChildComponent (switchToHostButton);
|
||||
|
||||
auto screenSize = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto screenSize = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
setSize (screenSize.getWidth(), screenSize.getHeight());
|
||||
|
||||
resized();
|
||||
|
|
|
|||
|
|
@ -510,7 +510,7 @@ public:
|
|||
soundNames = purchases.getVoiceNames();
|
||||
|
||||
#if JUCE_ANDROID || JUCE_IOS
|
||||
auto screenBounds = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto screenBounds = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
setSize (screenBounds.getWidth(), screenBounds.getHeight());
|
||||
#else
|
||||
setSize (800, 600);
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public:
|
|||
mainTabs.addTab ("Local", colour, &localNotificationsTabs, false);
|
||||
mainTabs.addTab ("Remote", colour, &remoteView, false);
|
||||
|
||||
auto userArea = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto userArea = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
#if JUCE_ANDROID || JUCE_IOS
|
||||
setSize (userArea.getWidth(), userArea.getHeight());
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@ private:
|
|||
//==============================================================================
|
||||
String getMachineInfoToDisplay() const
|
||||
{
|
||||
auto display = Desktop::getInstance().getDisplays().findDisplayForPoint (getScreenBounds().getCentre());
|
||||
return getOSName() + " " + String (display.dpi) + " " + String (display.scale);
|
||||
auto* display = Desktop::getInstance().getDisplays().getDisplayForPoint (getScreenBounds().getCentre());
|
||||
return getOSName() + " " + String (display->dpi) + " " + String (display->scale);
|
||||
}
|
||||
|
||||
static String getOSName()
|
||||
|
|
@ -180,8 +180,8 @@ private:
|
|||
if (auto client = canvas.findClient (clientName))
|
||||
{
|
||||
auto screenBounds = getScreenBounds();
|
||||
auto display = Desktop::getInstance().getDisplays().findDisplayForPoint (screenBounds.getCentre());
|
||||
return ((screenBounds - display.userArea.getCentre()).toFloat() / (client->scaleFactor * display.dpi / display.scale)) + client->centre;
|
||||
auto* display = Desktop::getInstance().getDisplays().getDisplayForPoint (screenBounds.getCentre());
|
||||
return ((screenBounds - display->userArea.getCentre()).toFloat() / (client->scaleFactor * display->dpi / display->scale)) + client->centre;
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
@ -191,8 +191,8 @@ private:
|
|||
{
|
||||
if (auto client = canvas.findClient (clientName))
|
||||
{
|
||||
auto display = Desktop::getInstance().getDisplays().findDisplayForPoint (getScreenBounds().getCentre());
|
||||
return (display.userArea.toFloat() / (client->scaleFactor * display.dpi / display.scale)).withCentre (client->centre);
|
||||
auto* display = Desktop::getInstance().getDisplays().getDisplayForPoint (getScreenBounds().getCentre());
|
||||
return (display->userArea.toFloat() / (client->scaleFactor * display->dpi / display->scale)).withCentre (client->centre);
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ void MainWindowList::checkWindowBounds (MainWindow& windowToCheck)
|
|||
auto ensureWindowIsFullyOnscreen = [&]
|
||||
{
|
||||
auto windowBounds = windowToCheck.getScreenBounds();
|
||||
auto screenLimits = Desktop::getInstance().getDisplays().findDisplayForRect (windowBounds).userArea;
|
||||
auto screenLimits = Desktop::getInstance().getDisplays().getDisplayForRect (windowBounds)->userArea;
|
||||
|
||||
if (auto* peer = windowToCheck.getPeer())
|
||||
peer->getFrameSize().subtractFrom (screenLimits);
|
||||
|
|
|
|||
|
|
@ -1096,7 +1096,7 @@ public:
|
|||
{
|
||||
auto screenBounds = peer->localToGlobal (peer->getBounds());
|
||||
|
||||
auto scale = Desktop::getInstance().getDisplays().findDisplayForRect (screenBounds, false).scale
|
||||
auto scale = Desktop::getInstance().getDisplays().getDisplayForRect (screenBounds, false)->scale
|
||||
/ Desktop::getInstance().getGlobalScaleFactor();
|
||||
|
||||
setContentScaleFactor ((float) scale);
|
||||
|
|
|
|||
|
|
@ -3234,7 +3234,7 @@ private:
|
|||
bool willCauseRecursiveResize (int w, int h)
|
||||
{
|
||||
auto newScreenBounds = Rectangle<int> (w, h).withPosition (getScreenPosition());
|
||||
return Desktop::getInstance().getDisplays().findDisplayForRect (newScreenBounds).scale != nativeScaleFactor;
|
||||
return Desktop::getInstance().getDisplays().getDisplayForRect (newScreenBounds)->scale != nativeScaleFactor;
|
||||
}
|
||||
|
||||
bool isWindowSizeCorrectForPlugin (int w, int h)
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ struct Component::ComponentHelpers
|
|||
if (auto* p = comp.getParentComponent())
|
||||
return p->getLocalBounds();
|
||||
|
||||
return Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
return Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
}
|
||||
|
||||
static void releaseAllCachedImageResources (Component& c)
|
||||
|
|
@ -1059,7 +1059,7 @@ int Component::getParentHeight() const noexcept
|
|||
|
||||
Rectangle<int> Component::getParentMonitorArea() const
|
||||
{
|
||||
return Desktop::getInstance().getDisplays().findDisplayForRect (getScreenBounds()).userArea;
|
||||
return Desktop::getInstance().getDisplays().getDisplayForRect (getScreenBounds())->userArea;
|
||||
}
|
||||
|
||||
int Component::getScreenX() const { return getScreenPosition().x; }
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ public:
|
|||
void refresh();
|
||||
/** @internal */
|
||||
~Displays() = default;
|
||||
// This method has been deprecated - use the findDisplayForPoint() or findDisplayForRect() methods instead
|
||||
// This method has been deprecated - use the getDisplayForPoint() or getDisplayForRect() methods instead
|
||||
// as they can deal with converting between logical and physical pixels
|
||||
JUCE_DEPRECATED (const Display& getDisplayContaining (Point<int> position) const noexcept);
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public:
|
|||
else
|
||||
jassertfalse; // seem to be trying to animate a component that's not visible..
|
||||
|
||||
auto scale = (float) Desktop::getInstance().getDisplays().findDisplayForRect (getScreenBounds()).scale
|
||||
auto scale = (float) Desktop::getInstance().getDisplays().getDisplayForRect (getScreenBounds())->scale
|
||||
* Component::getApproximateScaleFactorForComponent (&c);
|
||||
|
||||
image = c.createComponentSnapshot (c.getLocalBounds(), false, scale);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void ComponentBoundsConstrainer::setBoundsForComponent (Component* component,
|
|||
if (auto* peer = component->getPeer())
|
||||
border = peer->getFrameSize();
|
||||
|
||||
auto screenBounds = Desktop::getInstance().getDisplays().findDisplayForPoint (targetBounds.getCentre()).userArea;
|
||||
auto screenBounds = Desktop::getInstance().getDisplays().getDisplayForPoint (targetBounds.getCentre())->userArea;
|
||||
|
||||
limits = component->getLocalArea (nullptr, screenBounds) + component->getPosition();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,11 +649,11 @@ struct MenuWindow : public Component
|
|||
if (relativeTo != nullptr)
|
||||
targetPoint = relativeTo->localPointToGlobal (targetPoint);
|
||||
|
||||
auto parentArea = Desktop::getInstance().getDisplays().findDisplayForPoint (targetPoint * scaleFactor)
|
||||
auto parentArea = Desktop::getInstance().getDisplays().getDisplayForPoint (targetPoint * scaleFactor)
|
||||
#if JUCE_MAC || JUCE_ANDROID
|
||||
.userArea;
|
||||
->userArea;
|
||||
#else
|
||||
.totalArea; // on windows, don't stop the menu overlapping the taskbar
|
||||
->totalArea; // on windows, don't stop the menu overlapping the taskbar
|
||||
#endif
|
||||
|
||||
if (parentComponent == nullptr)
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ public:
|
|||
fullScreen (false),
|
||||
navBarsHidden (false),
|
||||
sizeAllocated (0),
|
||||
scale ((float) Desktop::getInstance().getDisplays().getMainDisplay().scale)
|
||||
scale ((float) Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale)
|
||||
{
|
||||
auto* env = getEnv();
|
||||
|
||||
|
|
@ -546,7 +546,7 @@ public:
|
|||
setNavBarsHidden (false);
|
||||
}
|
||||
|
||||
Rectangle<int> r (shouldBeFullScreen ? Desktop::getInstance().getDisplays().getMainDisplay().userArea
|
||||
Rectangle<int> r (shouldBeFullScreen ? Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea
|
||||
: lastNonFullscreenBounds);
|
||||
|
||||
if ((! shouldBeFullScreen) && r.isEmpty())
|
||||
|
|
@ -1428,7 +1428,7 @@ public:
|
|||
if (newBounds != oldBounds)
|
||||
{
|
||||
auto& displays = Desktop::getInstance().getDisplays();
|
||||
auto& mainDisplay = displays.getMainDisplay();
|
||||
auto& mainDisplay = *displays.getPrimaryDisplay();
|
||||
|
||||
Rectangle<int> userArea = newBounds / mainDisplay.scale;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ private:
|
|||
|
||||
controller.get().modalTransitionStyle = UIModalTransitionStyleCoverVertical;
|
||||
|
||||
auto bounds = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto bounds = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
setBounds (bounds);
|
||||
|
||||
setAlwaysOnTop (true);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
auto chooserBounds = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto chooserBounds = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
setBounds (chooserBounds);
|
||||
|
||||
setAlwaysOnTop (true);
|
||||
|
|
|
|||
|
|
@ -662,7 +662,7 @@ void UIViewComponentPeer::setFullScreen (bool shouldBeFullScreen)
|
|||
{
|
||||
if (! isSharedWindow)
|
||||
{
|
||||
auto r = shouldBeFullScreen ? Desktop::getInstance().getDisplays().getMainDisplay().userArea
|
||||
auto r = shouldBeFullScreen ? Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea
|
||||
: lastNonFullscreenBounds;
|
||||
|
||||
if ((! shouldBeFullScreen) && r.isEmpty())
|
||||
|
|
@ -681,7 +681,7 @@ void UIViewComponentPeer::updateScreenBounds()
|
|||
auto& desktop = Desktop::getInstance();
|
||||
|
||||
auto oldArea = component.getBounds();
|
||||
auto oldDesktop = desktop.getDisplays().getMainDisplay().userArea;
|
||||
auto oldDesktop = desktop.getDisplays().getPrimaryDisplay()->userArea;
|
||||
|
||||
const_cast<Displays&> (desktop.getDisplays()).refresh();
|
||||
|
||||
|
|
@ -696,7 +696,7 @@ void UIViewComponentPeer::updateScreenBounds()
|
|||
auto centreRelX = oldArea.getCentreX() / (float) oldDesktop.getWidth();
|
||||
auto centreRelY = oldArea.getCentreY() / (float) oldDesktop.getHeight();
|
||||
|
||||
auto newDesktop = desktop.getDisplays().getMainDisplay().userArea;
|
||||
auto newDesktop = desktop.getDisplays().getPrimaryDisplay()->userArea;
|
||||
|
||||
auto x = ((int) (newDesktop.getWidth() * centreRelX)) - (oldArea.getWidth() / 2);
|
||||
auto y = ((int) (newDesktop.getHeight() * centreRelY)) - (oldArea.getHeight() / 2);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ public:
|
|||
if (fullScreen != shouldBeFullScreen)
|
||||
{
|
||||
if (shouldBeFullScreen)
|
||||
r = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
r = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
|
||||
if (! r.isEmpty())
|
||||
setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, r), shouldBeFullScreen);
|
||||
|
|
@ -424,7 +424,7 @@ private:
|
|||
|
||||
Point<int> translation = (parentWindow != 0 ? getScreenPosition (isPhysical) : Point<int>());
|
||||
|
||||
auto newScaleFactor = Desktop::getInstance().getDisplays().findDisplayForRect (newBounds.translated (translation.x, translation.y), isPhysical).scale
|
||||
auto newScaleFactor = Desktop::getInstance().getDisplays().getDisplayForRect (newBounds.translated (translation.x, translation.y), isPhysical)->scale
|
||||
/ Desktop::getInstance().getGlobalScaleFactor();
|
||||
|
||||
if (! approximatelyEqual (newScaleFactor, currentScaleFactor))
|
||||
|
|
@ -467,7 +467,7 @@ JUCE_API void JUCE_CALLTYPE Process::hide() {}
|
|||
void Desktop::setKioskComponent (Component* comp, bool enableOrDisable, bool)
|
||||
{
|
||||
if (enableOrDisable)
|
||||
comp->setBounds (getDisplays().findDisplayForRect (comp->getScreenBounds()).totalArea);
|
||||
comp->setBounds (getDisplays().getDisplayForRect (comp->getScreenBounds())->totalArea);
|
||||
}
|
||||
|
||||
void Displays::findDisplays (float masterScale)
|
||||
|
|
|
|||
|
|
@ -2226,7 +2226,7 @@ void Desktop::setKioskComponent (Component* kioskComp, bool shouldBeEnabled, boo
|
|||
[NSApp setPresentationOptions: (allowMenusAndBars ? (NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar)
|
||||
: (NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar))];
|
||||
|
||||
kioskComp->setBounds (getDisplays().findDisplayForRect (kioskComp->getScreenBounds()).totalArea);
|
||||
kioskComp->setBounds (getDisplays().getDisplayForRect (kioskComp->getScreenBounds())->totalArea);
|
||||
peer->becomeKeyWindow();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ private:
|
|||
auto screenRectangle = Rectangle<int>::leftTopRightBottom (dialogScreenRect.left, dialogScreenRect.top,
|
||||
dialogScreenRect.right, dialogScreenRect.bottom);
|
||||
|
||||
auto scale = Desktop::getInstance().getDisplays().findDisplayForRect (screenRectangle, true).scale;
|
||||
auto scale = Desktop::getInstance().getDisplays().getDisplayForRect (screenRectangle, true)->scale;
|
||||
auto physicalComponentWidth = roundToInt (safeCustomComponent->getWidth() * scale);
|
||||
|
||||
SetWindowPos (hdlg, nullptr, screenRectangle.getX(), screenRectangle.getY(),
|
||||
|
|
@ -700,7 +700,7 @@ public:
|
|||
nativeFileChooser (new Win32NativeFileChooser (this, flags, previewComp, fileChooser.startingFile,
|
||||
fileChooser.title, fileChooser.filters))
|
||||
{
|
||||
auto mainMon = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
auto mainMon = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
|
||||
setBounds (mainMon.getX() + mainMon.getWidth() / 4,
|
||||
mainMon.getY() + mainMon.getHeight() / 4,
|
||||
|
|
|
|||
|
|
@ -1654,7 +1654,7 @@ public:
|
|||
// if the calling thread is DPI-aware but we are invalidating a non-DPI aware window RECT, we actually have to
|
||||
// divide the bounds by the scale factor as it will get multiplied for the virtualised paint callback...
|
||||
if (isPerMonitorDPIAwareThread() && ! isPerMonitorDPIAwareWindow (hwnd))
|
||||
scale = 1.0 / Desktop::getInstance().getDisplays().getMainDisplay().scale;
|
||||
scale = 1.0 / Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale;
|
||||
#endif
|
||||
|
||||
auto scaled = area.toDouble() * scale;
|
||||
|
|
@ -2175,9 +2175,9 @@ private:
|
|||
auto bounds = component.getBounds();
|
||||
|
||||
if (bounds.isEmpty())
|
||||
scaleFactor = Desktop::getInstance().getDisplays().getMainDisplay().scale;
|
||||
scaleFactor = Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale;
|
||||
else
|
||||
scaleFactor = Desktop::getInstance().getDisplays().findDisplayForRect (bounds).scale;
|
||||
scaleFactor = Desktop::getInstance().getDisplays().getDisplayForRect (bounds)->scale;
|
||||
|
||||
scaleFactor /= Desktop::getInstance().getGlobalScaleFactor();
|
||||
}
|
||||
|
|
@ -3419,7 +3419,7 @@ private:
|
|||
|
||||
if (fullScreen && ! isMinimised())
|
||||
setWindowPos (hwnd, ScalingHelpers::scaledScreenPosToUnscaled (component, Desktop::getInstance().getDisplays()
|
||||
.findDisplayForRect (component.getScreenBounds()).userArea),
|
||||
.getDisplayForRect (component.getScreenBounds())->userArea),
|
||||
SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOSENDCHANGING);
|
||||
}
|
||||
|
||||
|
|
@ -4455,7 +4455,7 @@ void Desktop::setKioskComponent (Component* kioskModeComp, bool enableOrDisable,
|
|||
tlw->setUsingNativeTitleBar (! enableOrDisable);
|
||||
|
||||
if (enableOrDisable)
|
||||
kioskModeComp->setBounds (getDisplays().findDisplayForRect (kioskModeComp->getScreenBounds()).totalArea);
|
||||
kioskModeComp->setBounds (getDisplays().getDisplayForRect (kioskModeComp->getScreenBounds())->totalArea);
|
||||
}
|
||||
|
||||
void Desktop::allowedOrientationsChanged() {}
|
||||
|
|
@ -4508,7 +4508,7 @@ static const Displays::Display* getCurrentDisplayFromScaleFactor (HWND hwnd)
|
|||
return retVal;
|
||||
}
|
||||
|
||||
return &Desktop::getInstance().getDisplays().getMainDisplay();
|
||||
return Desktop::getInstance().getDisplays().getPrimaryDisplay();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ CallOutBox::CallOutBox (Component& c, Rectangle<int> area, Component* const pare
|
|||
else
|
||||
{
|
||||
setAlwaysOnTop (juce_areThereAnyAlwaysOnTopWindows());
|
||||
updatePosition (area, Desktop::getInstance().getDisplays().findDisplayForRect (area).userArea);
|
||||
updatePosition (area, Desktop::getInstance().getDisplays().getDisplayForRect (area)->userArea);
|
||||
addToDesktop (ComponentPeer::windowIsTemporary);
|
||||
|
||||
startTimer (100);
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
|
|||
|
||||
if (onScreenArea.getWidth() * onScreenArea.getHeight() < 32 * 32)
|
||||
{
|
||||
auto screen = desktop.getDisplays().findDisplayForRect (newPos).userArea;
|
||||
auto screen = desktop.getDisplays().getDisplayForRect (newPos)->userArea;
|
||||
|
||||
newPos.setSize (jmin (newPos.getWidth(), screen.getWidth()),
|
||||
jmin (newPos.getHeight(), screen.getHeight()));
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ void TooltipWindow::displayTip (Point<int> screenPos, const String& tip)
|
|||
}
|
||||
else
|
||||
{
|
||||
updatePosition (tip, screenPos, Desktop::getInstance().getDisplays().findDisplayForPoint (screenPos).userArea);
|
||||
updatePosition (tip, screenPos, Desktop::getInstance().getDisplays().getDisplayForPoint (screenPos)->userArea);
|
||||
|
||||
addToDesktop (ComponentPeer::windowHasDropShadow
|
||||
| ComponentPeer::windowIsTemporary
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void SplashScreen::makeVisible (int w, int h, bool useDropShadow, bool fullscree
|
|||
clickCountToDelete = Desktop::getInstance().getMouseButtonClickCounter();
|
||||
creationTime = Time::getCurrentTime();
|
||||
|
||||
const Rectangle<int> screenSize = Desktop::getInstance().getDisplays().getMainDisplay().userArea;
|
||||
const Rectangle<int> screenSize = Desktop::getInstance().getDisplays().getPrimaryDisplay()->userArea;
|
||||
const int width = (fullscreen ? screenSize.getWidth() : w);
|
||||
const int height = (fullscreen ? screenSize.getHeight() : h);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
auto pos = topComp->getLocalPoint (&owner, Point<int>());
|
||||
|
||||
Rectangle<int> r (pos.x, pos.y, owner.getWidth(), owner.getHeight());
|
||||
r *= Desktop::getInstance().getDisplays().getMainDisplay().scale;
|
||||
r *= Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale;
|
||||
|
||||
getEnv()->CallVoidMethod (view, AndroidView.layout, r.getX(), r.getY(),
|
||||
r.getRight(), r.getBottom());
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ private:
|
|||
auto& displays = Desktop::getInstance().getDisplays();
|
||||
auto* peer = owner.getPeer();
|
||||
const double scale = (peer != nullptr ? peer->getPlatformScaleFactor()
|
||||
: displays.getMainDisplay().scale);
|
||||
: displays.getPrimaryDisplay()->scale);
|
||||
|
||||
Point<int> topLeftInPeer
|
||||
= (peer != nullptr ? peer->getComponent().getLocalPoint (&owner, Point<int> (0, 0))
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ public:
|
|||
auto env = getEnv();
|
||||
|
||||
lastBounds = bounds;
|
||||
auto r = bounds * Desktop::getInstance().getDisplays().getMainDisplay().scale;
|
||||
auto r = bounds * Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale;
|
||||
|
||||
env->CallVoidMethod (surfaceView.get(), JuceOpenGLViewSurface.layout,
|
||||
(jint) r.getX(), (jint) r.getY(), (jint) r.getRight(), (jint) r.getBottom());
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ public:
|
|||
void updateWindowPosition (Rectangle<int> bounds)
|
||||
{
|
||||
view.frame = convertToCGRect (bounds);
|
||||
glLayer.contentsScale = (CGFloat) (Desktop::getInstance().getDisplays().getMainDisplay().scale
|
||||
glLayer.contentsScale = (CGFloat) (Desktop::getInstance().getDisplays().getPrimaryDisplay()->scale
|
||||
/ component.getDesktopScaleFactor());
|
||||
|
||||
if (lastBounds != bounds)
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ public:
|
|||
if (auto* peer = component.getPeer())
|
||||
{
|
||||
auto localBounds = component.getLocalBounds();
|
||||
auto displayScale = Desktop::getInstance().getDisplays().findDisplayForRect (component.getTopLevelComponent()->getScreenBounds()).scale;
|
||||
auto displayScale = Desktop::getInstance().getDisplays().getDisplayForRect (component.getTopLevelComponent()->getScreenBounds())->scale;
|
||||
|
||||
auto newArea = peer->getComponent().getLocalArea (&component, localBounds).withZeroOrigin() * displayScale;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue