Skip to content

Commit

Permalink
[attributedlabel] Don't transform the rect used for the path.
Browse files Browse the repository at this point in the history
This caused Japanese strings to crop prematurely in certain scenarios.
  • Loading branch information
jverkoey committed Nov 15, 2012
1 parent 87a81b5 commit ed18ad2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/attributedlabel/src/NIAttributedLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -1432,9 +1432,7 @@ - (void)drawTextInRect:(CGRect)rect {
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attributedString);

CGMutablePathRef path = CGPathCreateMutable();
// We must transform the path rectangle in order to draw the text correctly for bottom/middle
// vertical alignment modes.
CGPathAddRect(path, &transform, rect);
CGPathAddRect(path, nil, rect);
self.textFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL);
CGPathRelease(path);
CFRelease(framesetter);
Expand Down

0 comments on commit ed18ad2

Please sign in to comment.