c1dfd75f2842 — David Douard 4 years ago
Do not go to the next line if the char to display does not fit
1 files changed, 7 insertions(+), 0 deletions(-)

M lib/unigraphic/GraphicsDisplay.cpp
M lib/unigraphic/GraphicsDisplay.cpp +7 -0
@@ 287,6 287,7 @@ void GraphicsDisplay::character(int x, i
     vert = font[2];                      // get vert size of font
     bpl = font[3];                       // bytes per line
 */
+	/*
     if (char_x + fonthor*fontzoomhor > oriented_width) {
         char_x = 0;
         char_y = char_y + fontvert*fontzoomver;

          
@@ 294,6 295,12 @@ void GraphicsDisplay::character(int x, i
             char_y = 0;
         }
     }
+	*/
+    if (char_x + fonthor*fontzoomhor > oriented_width) {
+		// a bit brutal, but meh
+		// so if the char to write crosses the width, do not display it
+		return;
+	}
     if ((c < firstch) || (c > lastch)) {   // test char range - if not exist fill with blank
 		window(char_x, char_y, fonthor*fontzoomhor, fontvert*fontzoomver); // char box
       window_pushpixel(_background, fontzoomhor*fonthor*fontvert*fontzoomver); //(color, howmany)