Commit dd19842e authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Felix Paul Kühne

macosx/fspanel: another minor optimization and simplification of the image drawing code

(cherry picked from commit 3d7bdcde)
parent b8992268
...@@ -586,26 +586,27 @@ ...@@ -586,26 +586,27 @@
[[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]]; [[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
} }
#define addImage(image, _x, _y, mode, _width) \ #define addImage(image, _x, _y, mode) \
image_rect.size = [image size]; \ image_size = [image size]; \
image_rect.size = image_size; \
image_rect.origin.x = 0; \ image_rect.origin.x = 0; \
image_rect.origin.y = 0; \ image_rect.origin.y = 0; \
frame.origin.x = _x; \ frame.origin.x = _x; \
frame.origin.y = _y; \ frame.origin.y = _y; \
frame.size = [image size]; \ frame.size = image_size; \
if( _width ) frame.size.width = _width; \
[image drawInRect:frame fromRect:image_rect operation:mode fraction:1]; [image drawInRect:frame fromRect:image_rect operation:mode fraction:1];
- (void)drawRect:(NSRect)rect - (void)drawRect:(NSRect)rect
{ {
NSRect frame = [self frame]; NSRect frame = [self frame];
NSRect image_rect; NSRect image_rect;
NSSize image_size;
NSImage *img; NSImage *img;
addImage( o_background_img, 0, 0, NSCompositeCopy, 0 ); addImage( o_background_img, 0, 0, NSCompositeCopy );
addImage( o_vol_sld_img, 26, 23, NSCompositeSourceOver, 0 ); addImage( o_vol_sld_img, 26, 23, NSCompositeSourceOver );
addImage( o_vol_mute_img, 16, 18, NSCompositeSourceOver, 0 ); addImage( o_vol_mute_img, 16, 18, NSCompositeSourceOver );
addImage( o_vol_max_img, 124, 18, NSCompositeSourceOver, 0 ); addImage( o_vol_max_img, 124, 18, NSCompositeSourceOver );
addImage( o_time_sld_img, 15, 53, NSCompositeSourceOver, 0); addImage( o_time_sld_img, 15, 53, NSCompositeSourceOver );
} }
@end @end
......
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