Various fixes to support creating images with specifying the size upfront.

[#41 milestone:0.5.2 state:resolved];
[#20 milestone:0.5.2 state:resolved];
This commit is contained in:
Ross Boucher
2008-09-17 22:39:25 -07:00
parent 53d4a714e2
commit e95c2b9efc
3 changed files with 49 additions and 23 deletions
+10 -3
View File
@@ -20,10 +20,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
import <Foundation/CPObject.j>
import <Foundation/CPString.j>
import <Foundation/CPBundle.j>
import <Foundation/CPNotificationCenter.j>
import <Foundation/CPObject.j>
import <Foundation/CPRunLoop.j>
import <Foundation/CPString.j>
import "CPGeometry.j"
@@ -35,6 +36,8 @@ CPImageLoadStatusInvalidData = 4;
CPImageLoadStatusUnexpectedEOF = 5;
CPImageLoadStatusReadError = 6;
CPImageDidLoadNotification = @"CPImageDidLoadNotification";
@implementation CPBundle (CPImageAdditions)
- (CPString)pathForResource:(CPString)aFilename
@@ -219,7 +222,11 @@ CPImageLoadStatusReadError = 6;
// FIXME: IE is wrong on image sizes????
if (!_size || (_size.width == -1 && _size.height == -1))
_size = CGSizeMake(_image.width, _image.height);
[[CPNotificationCenter defaultCenter]
postNotificationName:CPImageDidLoadNotification
object:self];
if ([_delegate respondsToSelector:@selector(imageDidLoad:)])
[_delegate imageDidLoad:self];