comparison Discovery/Src/gfx_engine.c @ 612:82d58470fd94

Bugfix inverted whitspace: In the print substring function white spaces are bypassed by just increasing the drawing position without really putting a pixel on the screen. As results white space were not draw as yellow boxes resulting in a bad inverted string visualization. => Changed implementation to not bypass inverted white spaces.
author Ideenmodellierer
date Fri, 15 Jan 2021 21:20:29 +0100
parents 3a6f922b73ea
children 8f78faf88fc5
comparison
equal deleted inserted replaced
611:916998f90e39 612:82d58470fd94
2237 while (*(char*)pText != 0)// und fehlend: Abfrage window / image size 2237 while (*(char*)pText != 0)// und fehlend: Abfrage window / image size
2238 { 2238 {
2239 if(*(char*)pText == '\t') 2239 if(*(char*)pText == '\t')
2240 cfg->Xdelta = hgfx->WindowTab - hgfx->WindowX0; 2240 cfg->Xdelta = hgfx->WindowTab - hgfx->WindowX0;
2241 else 2241 else
2242 if(*(char*)pText == ' ') 2242 if((*(char*)pText == ' ') && (cfg->invert == 0)) /* bypass drawing of white space only for not inverted mode */
2243 {
2243 cfg->Xdelta += ((tFont *)cfg->actualFont)->spacesize; 2244 cfg->Xdelta += ((tFont *)cfg->actualFont)->spacesize;
2245 }
2244 else 2246 else
2245 if((*(char*)pText) & 0x80) /* Identify a UNICODE character other than standard ASCII using the highest bit */ 2247 if((*(char*)pText) & 0x80) /* Identify a UNICODE character other than standard ASCII using the highest bit */
2246 { 2248 {
2247 decodeUTF8 = ((*(char*)pText) & 0x1F) << 6; /* use 5bits of first byte for upper part of unicode */ 2249 decodeUTF8 = ((*(char*)pText) & 0x1F) << 6; /* use 5bits of first byte for upper part of unicode */
2248 pText++; 2250 pText++;
2450 pSource += char_truncated_Height; 2452 pSource += char_truncated_Height;
2451 } 2453 }
2452 else 2454 else
2453 { 2455 {
2454 pSource++; 2456 pSource++;
2455 for (j = height; j > 0; j--) 2457 for (j = heightFont; j > 0; j--)
2456 { 2458 {
2457 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color; 2459 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color;
2458 *(__IO uint16_t*)(pDestination + nextLine) = cfg->color << 8 |0xFF; 2460 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color;
2459 pDestination += stepdir; 2461 pDestination += stepdir;
2460 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color; 2462 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color;
2461 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color; 2463 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color;
2462 pDestination += stepdir; 2464 pDestination += stepdir;
2463 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color; 2465 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color;
2464 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color; 2466 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color;
2465 pDestination += stepdir; 2467 pDestination += stepdir;
2466 *(__IO uint16_t*)pDestination = cfg->color << 8 |0xFF; 2468 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color;
2467 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color; 2469 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color;
2468 pDestination += stepdir; 2470 pDestination += stepdir;
2469 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color; 2471 *(__IO uint16_t*)pDestination = 0xFF << 8 | cfg->color;
2470 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color; 2472 *(__IO uint16_t*)(pDestination + nextLine) = 0xFF << 8 | cfg->color;
2471 pDestination += stepdir; 2473 pDestination += stepdir;