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 @@ ...@@ -248,25 +248,17 @@
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)proposedFrameSize - (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. ) if( videoRatio.height == 0. || videoRatio.width == 0. )
return proposedFrameSize; return proposedFrameSize;
if( [[[VLCMain sharedInstance] controls] aspectRatioIsLocked] )
{
NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil]; NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil];
NSRect contentRect = [self contentRectForFrameRect:[self frame]]; NSRect contentRect = [self contentRectForFrameRect:[self frame]];
float marginy = viewRect.origin.y + [self frame].size.height - contentRect.size.height; float marginy = viewRect.origin.y + [self frame].size.height - contentRect.size.height;
float marginx = contentRect.size.width - viewRect.size.width; float marginx = contentRect.size.width - viewRect.size.width;
proposedFrameSize.height = (proposedFrameSize.width - marginx) * videoRatio.height / videoRatio.width + marginy; proposedFrameSize.height = (proposedFrameSize.width - marginx) * videoRatio.height / videoRatio.width + marginy;
}
return proposedFrameSize; 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