Commit 57c73d74 authored by Felix Paul Kühne's avatar Felix Paul Kühne

legacy OS X intf: fixed locking the vout window's AR

parent 644bd843
......@@ -248,25 +248,17 @@
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize
{
NSView *playlist_area = [[o_vertical_split subviews] objectAtIndex:1];
NSRect newList = [playlist_area frame];
if( newList.size.height < 50 && newList.size.height > 0 ) {
[self togglePlaylist:self];
}
/* With no video open or with the playlist open the behavior is odd */
if( newList.size.height > 50 )
return proposedFrameSize;
if( videoRatio.height == 0. || videoRatio.width == 0. )
return proposedFrameSize;
if( [[[VLCMain sharedInstance] controls] aspectRatioIsLocked] )
{
NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil];
NSRect contentRect = [self contentRectForFrameRect:[self frame]];
float marginy = viewRect.origin.y + [self frame].size.height - contentRect.size.height;
float marginx = contentRect.size.width - viewRect.size.width;
proposedFrameSize.height = (proposedFrameSize.width - marginx) * videoRatio.height / videoRatio.width + marginy;
}
return proposedFrameSize;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment