changeset 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 916998f90e39
children beeb23d18443
files Discovery/Src/gfx_engine.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/gfx_engine.c	Thu Jan 14 21:25:15 2021 +0100
+++ b/Discovery/Src/gfx_engine.c	Fri Jan 15 21:20:29 2021 +0100
@@ -2239,8 +2239,10 @@
 		if(*(char*)pText == '\t')
 			cfg->Xdelta = hgfx->WindowTab - hgfx->WindowX0;
 		else
-		if(*(char*)pText == ' ')
+		if((*(char*)pText == ' ') && (cfg->invert == 0))	/* bypass drawing of white space only for not inverted mode */
+		{
 			cfg->Xdelta += ((tFont *)cfg->actualFont)->spacesize;
+		}
 		else
 		if((*(char*)pText) & 0x80) /* Identify a UNICODE character other than standard ASCII using the highest bit */
 		{
@@ -2452,10 +2454,10 @@
 				else
 				{
 					pSource++;
-					for (j = height; j > 0; j--)
+					for (j = heightFont; j > 0; j--)
 					{
 						*(__IO uint16_t*)pDestination =  0xFF << 8 | cfg->color;
-						*(__IO uint16_t*)(pDestination + nextLine) =  cfg->color << 8 |0xFF;
+						*(__IO uint16_t*)(pDestination + nextLine) =  0xFF << 8 | cfg->color;
 						pDestination += stepdir;
 						*(__IO uint16_t*)pDestination =  0xFF << 8 | cfg->color;
 						*(__IO uint16_t*)(pDestination + nextLine) =  0xFF << 8 | cfg->color;
@@ -2463,7 +2465,7 @@
 						*(__IO uint16_t*)pDestination =  0xFF << 8 | cfg->color;
 						*(__IO uint16_t*)(pDestination + nextLine) =  0xFF << 8 | cfg->color;
 						pDestination += stepdir;
-						*(__IO uint16_t*)pDestination =  cfg->color << 8 |0xFF;
+						*(__IO uint16_t*)pDestination =  0xFF << 8 | cfg->color;
 						*(__IO uint16_t*)(pDestination + nextLine) =  0xFF << 8 | cfg->color;
 						pDestination += stepdir;
 						*(__IO uint16_t*)pDestination =  0xFF << 8 | cfg->color;