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

ComponentPeer: Deprecate getFrameSize()

This commit is contained in:
attila 2022-01-27 13:19:13 +01:00
parent 454ff64631
commit 6575d24a81
8 changed files with 67 additions and 10 deletions

View file

@ -532,9 +532,12 @@ String ResizableWindow::getWindowStateAsString()
#if JUCE_LINUX
if (auto* peer = isOnDesktop() ? getPeer() : nullptr)
{
const auto frameSize = peer->getFrameSize();
stateString << " frame " << frameSize.getTop() << ' ' << frameSize.getLeft()
<< ' ' << frameSize.getBottom() << ' ' << frameSize.getRight();
if (const auto optionalFrameSize = peer->getFrameSizeIfPresent())
{
const auto& frameSize = *optionalFrameSize;
stateString << " frame " << frameSize.getTop() << ' ' << frameSize.getLeft()
<< ' ' << frameSize.getBottom() << ' ' << frameSize.getRight();
}
}
#endif
@ -610,7 +613,9 @@ bool ResizableWindow::restoreWindowStateFromString (const String& s)
if (peer != nullptr)
{
peer->getFrameSize().subtractFrom (newPos);
if (const auto frameSize = peer->getFrameSizeIfPresent())
frameSize->subtractFrom (newPos);
peer->setNonFullScreenBounds (newPos);
}