Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (47 sloc) 1.476 kb
//
// TCLayoutManager.m
// MarkdownLive
//
// Created by Akihiro Noguchi on 7/05/11.
// Copyright 2011 Aki. All rights reserved.
//
#import "EditPaneLayoutManager.h"
#import "EditPaneTypesetter.h"
@implementation EditPaneLayoutManager
@synthesize font;
- (id)init {
if ((self = [super init])) {
EditPaneTypesetter *typeSetter = [[EditPaneTypesetter alloc] init];
[self setTypesetter:typeSetter];
[typeSetter release];
[self setUsesFontLeading:NO];
}
return self;
}
- (void)dealloc {
self.font = nil;
[super dealloc];
}
- (CGFloat)lineHeight {
return floor([self defaultLineHeightForFont:font] + 1.5);
}
- (void)setLineFragmentRect:(NSRect)inFragmentRect forGlyphRange:(NSRange)inGlyphRange
usedRect:(NSRect)inUsedRect {
inFragmentRect.size.height = [self lineHeight];
inUsedRect.size.height = [self lineHeight];
(void)[super setLineFragmentRect:(NSRect)inFragmentRect
forGlyphRange:(NSRange)inGlyphRange
usedRect:(NSRect)inUsedRect];
}
- (void)setExtraLineFragmentRect:(NSRect)inFragmentRect usedRect:(NSRect)inUsedRect
textContainer:(NSTextContainer *)inTextContainer {
inFragmentRect.size.height = [self lineHeight];
[super setExtraLineFragmentRect:inFragmentRect usedRect:inUsedRect
textContainer:inTextContainer];
}
- (NSPoint)locationForGlyphAtIndex:(NSUInteger)inGlyphIndex {
NSPoint outPoint = [super locationForGlyphAtIndex:inGlyphIndex];
outPoint.y = [font pointSize];
return outPoint;
}
@end
Jump to Line
Something went wrong with that request. Please try again.