[vlc-commits] windowed mac plugin: fix controller resizing in fullscreen mode
Felix Paul Kühne
git at videolan.org
Wed Jan 16 02:09:47 CET 2013
npapi-vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 16 00:59:47 2013 +0100| [7ac0b4fd72e57216640f9ebc500317f813da79be] | committer: Felix Paul Kühne
windowed mac plugin: fix controller resizing in fullscreen mode
> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=7ac0b4fd72e57216640f9ebc500317f813da79be
---
npapi/vlcplugin_mac.mm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index 56b2986..fc79a1b 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -461,9 +461,10 @@ bool VlcPluginMac::handle_event(void *event)
CGContextSaveGState(cgContext);
/* Compute the position of the video */
- CGSize layerSize = [self preferredFrameSize];
- float left = (layerSize.width - media_width) / 2.;
- float top = (layerSize.height - media_height) / 2.;
+ NSRect layerRect = self.bounds;
+ float left = (layerRect.size.width - media_width) / 2.;
+ float top = (layerRect.size.height - media_height) / 2.;
+
static const size_t kComponentsPerPixel = 4;
static const size_t kBitsPerComponent = sizeof(unsigned char) * 8;
@@ -835,7 +836,7 @@ static CGImageRef createImageNamed(NSString *name)
[self center];
_customContentView = [[VLCFullscreenContentView alloc] initWithFrame:_initialFrame];
- [[self contentView] setAutoresizesSubviews:YES];
+ [_customContentView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[[self contentView] addSubview: _customContentView];
[self setInitialFirstResponder:_customContentView];
}
More information about the vlc-commits
mailing list