diff Discovery/Src/gfx_engine.c @ 537:0ad0b26ec56b

Added center / right alignment option to custom text display: Per default custom text was shown left aligned. Using '^' for center and '?' for right alignment the display of the custom text may now be improved. For proper operation the alignment had to be set to common handling mode and the blank characters had to be removed from the transmitted string. To avoid display of special strings (e.g. multilanguage) the write text via com interface will now block special characters
author Ideenmodellierer
date Wed, 07 Oct 2020 18:07:10 +0200
parents 56824129dd56
children 7b56d4eda695
line wrap: on
line diff
--- a/Discovery/Src/gfx_engine.c	Wed Oct 07 17:15:27 2020 +0200
+++ b/Discovery/Src/gfx_engine.c	Wed Oct 07 18:07:10 2020 +0200
@@ -2033,10 +2033,10 @@
 			if(*pText == '\r') // carriage return, no newline
 				settings.Xdelta = 0;
 			else
-			if((*pText == '\001') && !minimal) // center
+			if((*pText == '\001')) // center
 				settings.Xdelta = GFX_write__Modify_Xdelta__Centered(&settings, hgfx, pText+1);
 			else
-			if((*pText == '\002') && !minimal) // right
+			if((*pText == '\002')) // right
 				settings.Xdelta = GFX_write__Modify_Xdelta__RightAlign(&settings, hgfx, pText+1);
 			else
 			if((*pText == '\003') && !minimal) // doubleSize
@@ -2986,7 +2986,7 @@
 	
 	pText = (uint32_t)pTextInput;
 	counter = 0;
-	while((counter < 100) && (*(char*)pText != 0) && (*(char*)pText != '\r'))
+	while((counter < 100) && (*(char*)pText != 0) && (*(char*)pText != '\r') && (*(char*)pText != '\n'))
 	{
 		if((*(char*)pText) == TXT_2BYTE)
 		{