… | |
… | |
2308 | |
2308 | |
2309 | // sometimes we optimize away the trailing NOCHAR's, add them back |
2309 | // sometimes we optimize away the trailing NOCHAR's, add them back |
2310 | while (i && text[count] == NOCHAR) |
2310 | while (i && text[count] == NOCHAR) |
2311 | count++, i--; |
2311 | count++, i--; |
2312 | |
2312 | |
2313 | #if ENABLE_STYLES |
|
|
2314 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2315 | if (srp[col] & RS_Careful && col < TermWin.ncol - 1 && 0) |
|
|
2316 | drp[col + 1] = ~srp[col + 1]; |
|
|
2317 | |
|
|
2318 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2319 | while (text > stp |
|
|
2320 | && srp[text - stp - 1] & RS_Careful |
|
|
2321 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2322 | text--, count++, xpixel -= TermWin.fwidth; |
|
|
2323 | #endif |
|
|
2324 | |
|
|
2325 | /* |
2313 | /* |
2326 | * Determine the attributes for the string |
2314 | * Determine the attributes for the string |
2327 | */ |
2315 | */ |
2328 | int fore = GET_FGCOLOR (rend); // desired foreground |
2316 | int fore = GET_FGCOLOR (rend); // desired foreground |
2329 | int back = GET_BGCOLOR (rend); // desired background |
2317 | int back = GET_BGCOLOR (rend); // desired background |
2330 | |
2318 | |
2331 | // only do special processing if ana attributes are set, which is rare |
2319 | // only do special processing if any attributes are set, which is rare |
2332 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink)) |
2320 | if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) |
2333 | { |
2321 | { |
|
|
2322 | #if ENABLE_STYLES |
|
|
2323 | // force redraw after "careful" characters to avoid pixel droppings |
|
|
2324 | if (srp[col] & RS_Careful && col < TermWin.ncol - 1 && 0) |
|
|
2325 | drp[col + 1] = ~srp[col + 1]; |
|
|
2326 | |
|
|
2327 | // include previous careful character(s) if possible, looks nicer (best effort...) |
|
|
2328 | while (text > stp |
|
|
2329 | && srp[text - stp - 1] & RS_Careful |
|
|
2330 | && RS_SAME (rend, srp[text - stp - 1])) |
|
|
2331 | text--, count++, xpixel -= TermWin.fwidth; |
|
|
2332 | #endif |
|
|
2333 | |
2334 | bool invert = rend & RS_RVid; |
2334 | bool invert = rend & RS_RVid; |
2335 | |
2335 | |
2336 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2336 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2337 | if (rend & RS_Bold |
2337 | if (rend & RS_Bold |
2338 | && fore == Color_fg) |
2338 | && fore == Color_fg) |
… | |
… | |
2365 | SWAP_IT (fore, back, int); |
2365 | SWAP_IT (fore, back, int); |
2366 | |
2366 | |
2367 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2367 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
2368 | if (ISSET_PIXCOLOR (Color_RV)) |
2368 | if (ISSET_PIXCOLOR (Color_RV)) |
2369 | back = Color_RV; |
2369 | back = Color_RV; |
|
|
2370 | |
|
|
2371 | if (fore == back) |
|
|
2372 | { |
|
|
2373 | fore = Color_bg; |
|
|
2374 | back = Color_fg; |
|
|
2375 | } |
2370 | #endif |
2376 | #endif |
2371 | } |
2377 | } |
2372 | |
2378 | |
2373 | #ifdef TEXT_BLINK |
2379 | #ifdef TEXT_BLINK |
2374 | if (rend & RS_Blink && (back == Color_bg || fore == Color_bg)) |
2380 | if (rend & RS_Blink && (back == Color_bg || fore == Color_bg)) |