2008-02-18 00:11:38 +00:00
|
|
|
//
|
|
|
|
// FontSizetoLineHeightTransformer.m
|
|
|
|
// Cog
|
|
|
|
//
|
|
|
|
// Created by Matthew Grinshpun on 18/02/08.
|
|
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "FontSizetoLineHeightTransformer.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation FontSizetoLineHeightTransformer
|
|
|
|
|
|
|
|
+ (Class)transformedValueClass { return [NSNumber class]; }
|
|
|
|
+ (BOOL)allowsReverseTransformation { return NO; }
|
|
|
|
|
|
|
|
// Convert from font size to height in playlist view
|
|
|
|
- (id)transformedValue:(id)value {
|
|
|
|
NSFont *font = [NSFont systemFontOfSize:[(NSNumber *)value floatValue]];
|
2022-01-20 22:59:26 +00:00
|
|
|
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
|
2022-01-21 01:02:34 +00:00
|
|
|
float fRowSize = [layoutManager defaultLineHeightForFont:font];
|
2008-02-18 00:11:38 +00:00
|
|
|
return [NSNumber numberWithFloat: fRowSize];
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|