Commit bd6d91a0 authored by Marvin Scholz's avatar Marvin Scholz

macosx: Fix image tinting

This fixes the image tinting used in VLCTintedImageButtonCell, images
are now tinted correctly.
parent 7d8c37e1
......@@ -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];
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