From 432cd793d72758aae38069d2ef169ccb748e7900 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 24 Mar 2021 17:47:37 +0000 Subject: [PATCH] AudioPluginHost: Avoid drawing in unsafe areas of the screen on mobile --- extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp index f7a5b30880..0a1e7fc0f3 100644 --- a/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp +++ b/extras/AudioPluginHost/Source/UI/GraphEditorPanel.cpp @@ -1205,7 +1205,16 @@ GraphDocumentComponent::~GraphDocumentComponent() void GraphDocumentComponent::resized() { - auto r = getLocalBounds(); + auto r = [this] + { + auto bounds = getLocalBounds(); + + if (auto* display = Desktop::getInstance().getDisplays().getDisplayForRect (getScreenBounds())) + return display->safeAreaInsets.subtractedFrom (bounds); + + return bounds; + }(); + const int titleBarHeight = 40; const int keysHeight = 60; const int statusHeight = 20;