Skip to content

Commit 7dcdb0e

Browse files
committed
Fix Core Text rendering
1 parent 292d598 commit 7dcdb0e

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/MacVim/MMCoreTextView.m

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ - (void)drawString:(const UniChar *)chars length:(UniCharCount)length
14311431
}
14321432

14331433
CGContextSetRGBStrokeColor(context, RED(sp), GREEN(sp), BLUE(sp),
1434-
ALPHA(sp));
1434+
ALPHA(sp));
14351435
CGContextStrokePath(context);
14361436
}
14371437

@@ -1449,13 +1449,10 @@ - (void)drawString:(const UniChar *)chars length:(UniCharCount)length
14491449
CGContextSetFontSize(context, [font pointSize]);
14501450

14511451
// Calculate position of each glyph relative to (x,y).
1452-
if (!composing) {
1453-
float xrel = 0;
1454-
for (unsigned i = 0; i < length; ++i) {
1455-
positions[i].x = xrel;
1456-
positions[i].y = .0;
1457-
xrel += w;
1458-
}
1452+
float xrel = composing ? .0 : w;
1453+
for (unsigned i = 0; i < length; ++i) {
1454+
positions[i].x = i * xrel;
1455+
positions[i].y = .0;
14591456
}
14601457

14611458
CTFontRef fontRef = (CTFontRef)(wide ? [fontWide retain]

0 commit comments

Comments
 (0)