diff mbox series

[PULL,07/12] ui/cocoa: Fix pause label coordinates

Message ID 20240305110608.21618-8-philmd@linaro.org
State Accepted
Commit 1a4b64a5f5a7dd96fcc84aedb157700d9da8c54d
Headers show
Series [PULL,01/12] ui/cocoa: add zoom-interpolation display option | expand

Commit Message

Philippe Mathieu-Daudé March 5, 2024, 11:06 a.m. UTC
From: Akihiko Odaki <akihiko.odaki@daynix.com>

A subview is positioned in the superview so the superview's frame
should be used instead of one of the window to determine the
coordinates.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Rene Engel <ReneEngel80@emailn.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20240224-cocoa-v12-5-e89f70bdda71@daynix.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 ui/cocoa.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6e8cd24e88..a2e52ceabc 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1451,8 +1451,8 @@  - (void)displayPause
 {
     /* Coordinates have to be calculated each time because the window can change its size */
     int xCoord, yCoord, width, height;
-    xCoord = ([normalWindow frame].size.width - [pauseLabel frame].size.width)/2;
-    yCoord = [normalWindow frame].size.height - [pauseLabel frame].size.height - ([pauseLabel frame].size.height * .5);
+    xCoord = ([cocoaView frame].size.width - [pauseLabel frame].size.width)/2;
+    yCoord = [cocoaView frame].size.height - [pauseLabel frame].size.height - ([pauseLabel frame].size.height * .5);
     width = [pauseLabel frame].size.width;
     height = [pauseLabel frame].size.height;
     [pauseLabel setFrame: NSMakeRect(xCoord, yCoord, width, height)];