From ce29e58fe3bd82a53413f79aa59d6c8e0c4a89fd Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Feb 2013 10:10:27 +0100 Subject: cocoa_common: make the resize window menu items use video size Make the window resizing menu items calculate the new window size based on the video size and not the current window size. This only makes a difference when using `--autofit`. --- video/out/cocoa_common.m | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'video') diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 4f60eb9cba..5822e75431 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -852,12 +852,7 @@ void create_menu() andEventID:kAEQuitApplication]; } -- (void)normalSize -{ - struct vo_cocoa_state *s = _vo->cocoa; - if (!vo_fs) - [self setContentSize:s->current_video_size keepCentered:YES]; -} +- (void)normalSize { [self mulSize:1.0f]; } - (void)halfSize { [self mulSize:0.5f];} @@ -866,10 +861,10 @@ void create_menu() - (void)mulSize:(float)multiplier { if (!vo_fs) { - struct vo_cocoa_state *s = _vo->cocoa; - NSSize size = [[self contentView] frame].size; - size.width = s->current_video_size.width * (multiplier); - size.height = s->current_video_size.height * (multiplier); + NSSize size = { + .width = _vo->aspdat.prew * multiplier, + .height = _vo->aspdat.preh * multiplier + }; [self setContentSize:size keepCentered:YES]; } } -- cgit v1.2.3