Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.
Dependents: FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more
Fork of SPI_TFT by
See Components - RA8875 Based Display
Enhanced touch-screen support - where it previous supported both the Resistive Touch and Capacitive Touch based on the FT5206 Touch Controller, now it also has support for the GSL1680 Touch Controller.
Offline Help Manual (Windows chm)
/media/uploads/WiredHome/ra8875.zip.bin (download, rename to .zip and unzip)
Diff: RA8875.cpp
- Revision:
- 144:ba002c4b21b3
- Parent:
- 143:e872d65a710d
- Child:
- 146:373d59f08357
--- a/RA8875.cpp Sun Mar 19 22:11:04 2017 +0000 +++ b/RA8875.cpp Sat May 06 20:14:48 2017 +0000 @@ -1406,6 +1406,31 @@ return noerror; } + +RetCode_t RA8875::ThickLine(point_t p1, point_t p2, dim_t thickness, color_t color) +{ + if (thickness == 1) { + line(p1,p2, color); + } else { + int dx = abs(p2.x-p1.x), sx = p1.x<p2.x ? 1 : -1; + int dy = abs(p2.y-p1.y), sy = p1.y<p2.y ? 1 : -1; + int err = (dx>dy ? dx : -dy)/2, e2; + + for (;;) { + fillcircle(p1.x, p1.y, thickness/2, color); + if (p1.x==p2.x && p1.y==p2.y) + break; + e2 = err; + if (e2 >-dx) + { err -= dy; p1.x += sx; } + if (e2 < dy) + { err += dx; p1.y += sy; } + } + } + return noerror; +} + + // // Rectangle functions all mostly helpers to the basic rectangle function //