Commits

Jason Harris committed 3a170d0

- Fix issue #309 where the icon tree would draw in a corrupted way if there was no icon
image.

Comments (0)

Files changed (1)

Classes/FilesView/FSNodeInfo.m

 
 + (NSImage*) compositeRowOfIcons:(NSArray*)icons withOverlap:(CGFloat)overlap
 {
-	CGFloat hsize = ICON_SIZE + ceil(ICON_SIZE * ([icons count] - 1)/overlap);
+	NSInteger adjustedIconCount = MAX([icons count] - 1, 0);
+	CGFloat hsize = ceil(ICON_SIZE * (1 + adjustedIconCount / overlap));
 	NSImage* combinedImage = [[NSImage alloc] initWithSize:NSMakeSize(hsize,  ICON_SIZE)];
 	NSRect imageFrame = NSMakeRect(0, 0, ICON_SIZE, ICON_SIZE);
 	[combinedImage lockFocus];