Mercurial > dwindows
comparison mac/dw.m @ 1709:de49c1f284b2
Safety check for the icon resize code on Mac and GTK.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 05 May 2012 21:41:57 +0000 |
parents | cc10082567ed |
children | daa59fc8d6e5 |
comparison
equal
deleted
inserted
replaced
1708:cc10082567ed | 1709:de49c1f284b2 |
---|---|
6817 } | 6817 } |
6818 | 6818 |
6819 /* Internal function to keep HICNs from getting too big */ | 6819 /* Internal function to keep HICNs from getting too big */ |
6820 void _icon_resize(NSImage *image) | 6820 void _icon_resize(NSImage *image) |
6821 { | 6821 { |
6822 NSSize size = [image size]; | 6822 if(image) |
6823 if(size.width > 24 || size.height > 24) | 6823 { |
6824 { | 6824 NSSize size = [image size]; |
6825 if(size.width > 24) | 6825 if(size.width > 24 || size.height > 24) |
6826 size.width = 24; | 6826 { |
6827 if(size.height > 24) | 6827 if(size.width > 24) |
6828 size.height = 24; | 6828 size.width = 24; |
6829 [image setSize:size]; | 6829 if(size.height > 24) |
6830 size.height = 24; | |
6831 [image setSize:size]; | |
6832 } | |
6830 } | 6833 } |
6831 } | 6834 } |
6832 | 6835 |
6833 /* | 6836 /* |
6834 * Obtains an icon from a module (or header in GTK). | 6837 * Obtains an icon from a module (or header in GTK). |