[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v12 05/10] ui/cocoa: Fix pause label coordinates
From: |
Akihiko Odaki |
Subject: |
[PATCH v12 05/10] ui/cocoa: Fix pause label coordinates |
Date: |
Sat, 24 Feb 2024 21:43:36 +0900 |
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>
---
ui/cocoa.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 644fd32eaa4d..df8072479c82 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1432,8 +1432,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)];
--
2.43.2
- [PATCH v12 00/10] ui/cocoa: Use NSWindow's ability to resize, Akihiko Odaki, 2024/02/24
- [PATCH v12 01/10] ui/cocoa: Split [-QemuCocoaView handleEventLocked:], Akihiko Odaki, 2024/02/24
- [PATCH v12 02/10] ui/cocoa: Immediately call [-QemuCocoaView handleMouseEvent:buttons:], Akihiko Odaki, 2024/02/24
- [PATCH v12 03/10] ui/cocoa: Release specific mouse buttons, Akihiko Odaki, 2024/02/24
- [PATCH v12 04/10] ui/cocoa: Scale with NSView instead of Core Graphics, Akihiko Odaki, 2024/02/24
- [PATCH v12 05/10] ui/cocoa: Fix pause label coordinates,
Akihiko Odaki <=
- [PATCH v12 06/10] ui/cocoa: Let the platform toggle fullscreen, Akihiko Odaki, 2024/02/24
- [PATCH v12 07/10] ui/cocoa: Remove normalWindow, Akihiko Odaki, 2024/02/24
- [PATCH v12 08/10] ui/cocoa: Make window resizable, Akihiko Odaki, 2024/02/24
- [PATCH v12 09/10] ui/cocoa: Call console_select() with the BQL, Akihiko Odaki, 2024/02/24
- [PATCH v12 10/10] ui/cocoa: Remove stretch_video flag, Akihiko Odaki, 2024/02/24
- Re: [PATCH v12 00/10] ui/cocoa: Use NSWindow's ability to resize, Philippe Mathieu-Daudé, 2024/02/26