mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge pull request #681 from ichizok/fix/coretext-renderer
Fix Core Text renderer
This commit is contained in:
@@ -1431,7 +1431,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
}
|
||||
|
||||
CGContextSetRGBStrokeColor(context, RED(sp), GREEN(sp), BLUE(sp),
|
||||
ALPHA(sp));
|
||||
ALPHA(sp));
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
@@ -1449,13 +1449,10 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
|
||||
CGContextSetFontSize(context, [font pointSize]);
|
||||
|
||||
// Calculate position of each glyph relative to (x,y).
|
||||
if (!composing) {
|
||||
float xrel = 0;
|
||||
for (unsigned i = 0; i < length; ++i) {
|
||||
positions[i].x = xrel;
|
||||
positions[i].y = .0;
|
||||
xrel += w;
|
||||
}
|
||||
float xrel = composing ? .0 : w;
|
||||
for (unsigned i = 0; i < length; ++i) {
|
||||
positions[i].x = i * xrel;
|
||||
positions[i].y = .0;
|
||||
}
|
||||
|
||||
CTFontRef fontRef = (CTFontRef)(wide ? [fontWide retain]
|
||||
|
||||
+9
-3
@@ -8388,7 +8388,13 @@ screen_char(unsigned off, int row, int col)
|
||||
{
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
|
||||
if (utf_ambiguous_width(ScreenLinesUC[off]))
|
||||
if (utf_ambiguous_width(ScreenLinesUC[off])
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
/* In the GUI, check if the cell width is actually 1 in order
|
||||
* to display 2-cells emoji correctly. */
|
||||
&& (!gui.in_use || utf_char2cells(ScreenLinesUC[off]) == 1)
|
||||
# endif
|
||||
)
|
||||
{
|
||||
if (*p_ambw == 'd'
|
||||
# ifdef FEAT_GUI
|
||||
@@ -8404,9 +8410,9 @@ screen_char(unsigned off, int row, int col)
|
||||
/* not sure where the cursor is after drawing the ambiguous width
|
||||
* character */
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
if (*p_ambw == 'd' || !gui.in_use)
|
||||
if (*p_ambw == 'd' || !gui.in_use)
|
||||
# endif
|
||||
screen_cur_col = 9999;
|
||||
screen_cur_col = 9999;
|
||||
}
|
||||
else if (utf_char2cells(ScreenLinesUC[off]) > 1)
|
||||
++screen_cur_col;
|
||||
|
||||
Reference in New Issue
Block a user