mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 9.0.0720: MS-Windows GUI may have pixel dust from antialiasing
Problem: MS-Windows GUI may have pixel dust from antialiasing. Solution: When a character changes also redraw the next one. (issue #8532)
This commit is contained in:
22
src/screen.c
22
src/screen.c
@@ -475,6 +475,10 @@ screen_line(
|
|||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
int redraw_next; // redraw_this for next character
|
int redraw_next; // redraw_this for next character
|
||||||
|
#ifdef FEAT_GUI_MSWIN
|
||||||
|
int changed_this; // TRUE if character changed
|
||||||
|
int changed_next; // TRUE if next character changed
|
||||||
|
#endif
|
||||||
int clear_next = FALSE;
|
int clear_next = FALSE;
|
||||||
int char_cells; // 1: normal char
|
int char_cells; // 1: normal char
|
||||||
// 2: occupies two display cells
|
// 2: occupies two display cells
|
||||||
@@ -534,6 +538,9 @@ screen_line(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
redraw_next = char_needs_redraw(off_from, off_to, endcol - col);
|
redraw_next = char_needs_redraw(off_from, off_to, endcol - col);
|
||||||
|
#ifdef FEAT_GUI_MSWIN
|
||||||
|
changed_next = redraw_next;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (col < endcol)
|
while (col < endcol)
|
||||||
{
|
{
|
||||||
@@ -547,15 +554,24 @@ screen_line(
|
|||||||
off_to + char_cells, endcol - col - char_cells);
|
off_to + char_cells, endcol - col - char_cells);
|
||||||
|
|
||||||
#ifdef FEAT_GUI
|
#ifdef FEAT_GUI
|
||||||
|
# ifdef FEAT_GUI_MSWIN
|
||||||
|
changed_this = changed_next;
|
||||||
|
changed_next = redraw_next;
|
||||||
|
# endif
|
||||||
// If the next character was bold, then redraw the current character to
|
// If the next character was bold, then redraw the current character to
|
||||||
// remove any pixels that might have spilt over into us. This only
|
// remove any pixels that might have spilt over into us. This only
|
||||||
// happens in the GUI.
|
// happens in the GUI.
|
||||||
|
// With MS-Windows antialiasing may also cause pixels to spill over
|
||||||
|
// from a previous character, no matter attributes, always redraw if a
|
||||||
|
// character changed.
|
||||||
if (redraw_next && gui.in_use)
|
if (redraw_next && gui.in_use)
|
||||||
{
|
{
|
||||||
|
# ifndef FEAT_GUI_MSWIN
|
||||||
hl = ScreenAttrs[off_to + char_cells];
|
hl = ScreenAttrs[off_to + char_cells];
|
||||||
if (hl > HL_ALL)
|
if (hl > HL_ALL)
|
||||||
hl = syn_attr2attr(hl);
|
hl = syn_attr2attr(hl);
|
||||||
if (hl & HL_BOLD)
|
if (hl & HL_BOLD)
|
||||||
|
# endif
|
||||||
redraw_this = TRUE;
|
redraw_this = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -688,6 +704,12 @@ screen_line(
|
|||||||
if (hl & HL_BOLD)
|
if (hl & HL_BOLD)
|
||||||
redraw_next = TRUE;
|
redraw_next = TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef FEAT_GUI_MSWIN
|
||||||
|
// MS-Windows antialiasing may spill over to the next character,
|
||||||
|
// redraw that one if this one changed, no matter attributes.
|
||||||
|
if (gui.in_use && changed_this)
|
||||||
|
redraw_next = TRUE;
|
||||||
#endif
|
#endif
|
||||||
ScreenAttrs[off_to] = ScreenAttrs[off_from];
|
ScreenAttrs[off_to] = ScreenAttrs[off_from];
|
||||||
|
|
||||||
|
@@ -699,6 +699,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
720,
|
||||||
/**/
|
/**/
|
||||||
719,
|
719,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user