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.
Fork of RA8875 by
Diff: RA8875.cpp
- Revision:
- 144:ba002c4b21b3
- Parent:
- 143:e872d65a710d
- Child:
- 146:373d59f08357
diff -r e872d65a710d -r ba002c4b21b3 RA8875.cpp
--- 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
//
