NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
Hi, I have a subclass of NSAttachmentCell which draws itself into an NSTextView. Its y-location is wrong though when drawing the cell using - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *) controlView characterIndex:(NSUInteger)charIndex layoutManager: (NSLayoutManager

Re: NSAttributedString location for drawing, glyph location and baseline

2012-07-15 Thread Alexander Reichstadt
I think I found it in, at least it looks correct: CGFloat gb = [[NSTypesetter sharedSystemTypesetter] baselineOffsetInLayoutManager:[(NSTextView *)controlView layoutManager] glyphIndex:charIndex]; NSRect useFrame = cellFrame; useFrame.origin.y += gb; Thanks Am 15.07.2012 um 23:40 schrieb