macosx: Fix image tinting
authorMarvin Scholz <epirat07@gmail.com>
Wed, 12 Jul 2017 00:53:09 +0000 (02:53 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Wed, 12 Jul 2017 00:54:30 +0000 (02:54 +0200)
This fixes the image tinting used in VLCTintedImageButtonCell, images
are now tinted correctly.

modules/gui/macosx/VLCTintedImageButtonCell.m

index afe64cb..e440ecc 100644 (file)
 - (NSImage *)image:(NSImage*)image tintedWithColor:(NSColor *)tint
 {
     image = [image copy];
+    [image setTemplate:NO];
     if (tint) {
         [image lockFocus];
-        [tint set];
         NSRect imageRect = {NSZeroPoint, [image size]};
+        [tint setFill];
         NSRectFillUsingOperation(imageRect, NSCompositeSourceAtop);
         [image unlockFocus];
-        [image setTemplate:NO];
     }
     return image;
 }
@@ -81,6 +81,7 @@
 
 - (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView
 {
+    image = [self tintedImage:image];
     [super drawImage:image withFrame:frame inView:controlView];
 }