5 // Created by Doug Dickinson on Sat May 24 2003.
6 // Copyright (c) 2003 Doug Dickinson (dasher AT DressTheMonkey DOT plus DOT com). All rights reserved.
9 #import <AppKit/AppKit.h>
10 #import "ZippyStringImage.h"
13 @implementation ZippyStringImage
15 - (id)initWithString:(NSString *)aString attributes:(NSDictionary *)someAttributes {
16 if (self = [super initWithString:aString attributes:someAttributes]) {
17 NSSize s = [self size];
18 if ([aString length] == 1 && s.width != 0 && s.height != 0) {
19 NSImage *m = [[NSImage alloc] initWithSize:s];
22 [self drawAtPoint:NSMakePoint(0, 0)];
32 - (void)drawAtPoint:(NSPoint)aPoint {
33 if ([self image] != nil) {
34 NSPoint at = NSMakePoint(aPoint.x, aPoint.y + [self size].height);
35 [[self image] compositeToPoint:at operation:NSCompositeSourceAtop];
39 [super drawAtPoint:aPoint];
44 return [[_image retain] autorelease];
47 - (void)setImage:(NSImage *)value {
48 if (_image != value) {
50 _image = [value retain];