0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00

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`.
This commit is contained in:
Stefano Pigozzi 2013-02-03 10:10:27 +01:00
parent 68fa3c49db
commit ce29e58fe3

View File

@ -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];
}
}