mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 22:01:10 +00: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:
parent
68fa3c49db
commit
ce29e58fe3
@ -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];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user