Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: LV7_LCDtest LV7_Grupa5_Tim003_Zadatak1 lv7_Grupa5_Tim008_zad1 LV7_PAI_Grupa5_tim10_Zadatak1 ... more
Revision 27:0d8d90936b4c, committed 2017-02-07
- Comitter:
- eencae
- Date:
- Tue Feb 07 21:50:25 2017 +0000
- Parent:
- 26:36be85c20ef4
- Child:
- 28:4091516537e4
- Child:
- 30:11986573659e
- Commit message:
- Fixed bug in drawRect() that causes sizes to be off by 1 pixel.
Changed in this revision
| N5110.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/N5110.cpp Tue Feb 07 11:24:32 2017 +0000
+++ b/N5110.cpp Tue Feb 07 21:50:25 2017 +0000
@@ -381,14 +381,14 @@
void N5110::drawRect(int x0,int y0,int width,int height,int fill)
{
if (fill == 0) { // transparent, just outline
- drawLine(x0,y0,x0+width,y0,1); // top
- drawLine(x0,y0+height,x0+width,y0+height,1); // bottom
- drawLine(x0,y0,x0,y0+height,1); // left
- drawLine(x0+width,y0,x0+width,y0+height,1); // right
+ drawLine(x0,y0,x0+(width-1),y0,1); // top
+ drawLine(x0,y0+(height-1),x0+(width-1),y0+(height-1),1); // bottom
+ drawLine(x0,y0,x0,y0+(height-1),1); // left
+ drawLine(x0+(width-1),y0,x0+(width-1),y0+(height-1),1); // right
} else { // filled rectangle
int type = (fill==1) ? 1:0; // black or white fill
- for (int y = y0; y<= y0+height; y++) { // loop through rows of rectangle
- drawLine(x0,y,x0+width,y,type); // draw line across screen
+ for (int y = y0; y<y0+height; y++) { // loop through rows of rectangle
+ drawLine(x0,y,x0+(width-1),y,type); // draw line across screen
}
}
}
