diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-02-07 21:59:43 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-02-07 21:59:43 +1000 |
commit | 112852ffc3251390b44995690b156f6a942403e5 (patch) | |
tree | 9f0797eeccf1c5d785864570ba7bff620a0976da /demos | |
parent | d532ab02c35cc2ee461f426477a3fdd9f84d8833 (diff) | |
download | uGFX-112852ffc3251390b44995690b156f6a942403e5.tar.gz uGFX-112852ffc3251390b44995690b156f6a942403e5.tar.bz2 uGFX-112852ffc3251390b44995690b156f6a942403e5.zip |
Update multiple display demo to display better on very small displays.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/modules/gdisp/multiple_displays/main.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/demos/modules/gdisp/multiple_displays/main.c b/demos/modules/gdisp/multiple_displays/main.c index 387ca690..0a474d0f 100644 --- a/demos/modules/gdisp/multiple_displays/main.c +++ b/demos/modules/gdisp/multiple_displays/main.c @@ -69,9 +69,14 @@ height = gdispGGetHeight(g); /* Draw draw draw */ - gdispGDrawBox(g, 10, 10, width/2, height/2, Yellow); sprintg(buf, "Display %u", display); - gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + if (width < 128) { + gdispGDrawBox(g, 0, 0, width/2, height/2, Yellow); + gdispGFillStringBox(g, 0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); + } else { + gdispGDrawBox(g, 10, 10, width/2, height/2, Yellow); + gdispGFillStringBox(g, width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + } gdispGDrawLine(g, 5, 30, width-50, height-40, Red); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) @@ -107,9 +112,14 @@ height = gdispGetHeight(); /* Draw draw draw */ - gdispDrawBox(10, 10, width/2, height/2, Yellow); sprintg(buf, "Display %u", display); - gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + if (width < 128) { + gdispDrawBox(0, 0, width/2, height/2, Yellow); + gdispFillStringBox(0, height/2, width, height/2, buf, f, Black, Blue, justifyCenter); + } else { + gdispDrawBox(10, 10, width/2, height/2, Yellow); + gdispFillStringBox(width/2, height/2, width/2-10, height/2-10, buf, f, White, Blue, justifyCenter); + } gdispDrawLine(5, 30, width-50, height-40, Red); for(i = 5, j = 0; i < width && j < height; i += 7, j += i/20) |