]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald_watch_faces.c
Some minor improvements.
[oswald.git] / ui / oswald_watch_faces.c
index 284323ac30787e91f9244a9950ab67af083e0212..b955c74af738776008b35a775c8617b7c6d7dbf4 100644 (file)
@@ -271,13 +271,22 @@ void DrawLcdDigitalClock(boolean show_seconds)
        gRow = 0;
        gColumn = 45;
        for (i=0; i<strlen(MainMessage); i++) {
+               // do not draw a whitespace as first character of a row
                if (gRow == 0 && MainMessage[i] == ' ')
                        continue;
+               // interpret new line
+               if (MainMessage[i] == '\n') {
+                       gRow = 0;
+                       gColumn += 9;
+                       continue;
+               }
                gRow += oswald_write_character(gRow, gColumn, FONT_DROID8x12, FALSE, MainMessage[i]);
+               // wrap to new line if line is full
                if (gRow > 90) {
                        gRow = 0;
                        gColumn += 9;
                }
+               // OK, screen ends, leave the loop, no matter what
                if (gColumn > 86)
                        i = 255;
        }