summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-02-03 10:10:27 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-02-03 10:18:55 +0100
commitce29e58fe3bd82a53413f79aa59d6c8e0c4a89fd (patch)
treefde7fcc57b6c2f739bd589a83770c584b1352a43 /video/out/cocoa_common.m
parent68fa3c49db720645da2c653a8c8f9d92c0d6815f (diff)
downloadmpv-ce29e58fe3bd82a53413f79aa59d6c8e0c4a89fd.tar.bz2
mpv-ce29e58fe3bd82a53413f79aa59d6c8e0c4a89fd.tar.xz
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`.
Diffstat (limited to 'video/out/cocoa_common.m')
-rw-r--r--video/out/cocoa_common.m15
1 files changed, 5 insertions, 10 deletions
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];
}
}