[vlc-commits] macosx: Fix image tinting

Marvin Scholz git at videolan.org
Wed Jul 12 02:56:50 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Jul 12 02:53:09 2017 +0200| [bd6d91a098aaa1e17eb8d3eefdd0e134a12e6856] | committer: Marvin Scholz

macosx: Fix image tinting

This fixes the image tinting used in VLCTintedImageButtonCell, images
are now tinted correctly.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd6d91a098aaa1e17eb8d3eefdd0e134a12e6856
---

 modules/gui/macosx/VLCTintedImageButtonCell.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCTintedImageButtonCell.m b/modules/gui/macosx/VLCTintedImageButtonCell.m
index afe64cb9ab..e440ecc871 100644
--- a/modules/gui/macosx/VLCTintedImageButtonCell.m
+++ b/modules/gui/macosx/VLCTintedImageButtonCell.m
@@ -58,13 +58,13 @@
 - (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];
 }
 



More information about the vlc-commits mailing list