Fixed off-by-one error in rendering of the 7-segment segments.
This commit is contained in:
@@ -574,12 +574,12 @@ class Meter {
|
|||||||
void draw_segment_(Display &it, int x, int y, int w, int h, bool horizontal, Color color) {
|
void draw_segment_(Display &it, int x, int y, int w, int h, bool horizontal, Color color) {
|
||||||
if (horizontal) {
|
if (horizontal) {
|
||||||
int cap = h / 2;
|
int cap = h / 2;
|
||||||
it.filled_rectangle(x + cap, y, w - 2 * cap, h, color);
|
it.filled_rectangle(x + cap, y, w - 2 * cap, h +1, color);
|
||||||
it.filled_triangle(x, y + cap, x + cap, y, x + cap, y + h, color);
|
it.filled_triangle(x, y + cap, x + cap, y, x + cap, y + h, color);
|
||||||
it.filled_triangle(x + w, y + cap, x + w - cap, y, x + w - cap, y + h, color);
|
it.filled_triangle(x + w, y + cap, x + w - cap, y, x + w - cap, y + h, color);
|
||||||
} else {
|
} else {
|
||||||
int cap = w / 2;
|
int cap = w / 2;
|
||||||
it.filled_rectangle(x, y + cap, w, h - 2 * cap, color);
|
it.filled_rectangle(x, y + cap, w +1, h - 2 * cap, color);
|
||||||
it.filled_triangle(x + cap, y, x, y + cap, x + w, y + cap, color);
|
it.filled_triangle(x + cap, y, x, y + cap, x + w, y + cap, color);
|
||||||
it.filled_triangle(x + cap, y + h, x, y + h - cap, x + w, y + h - cap, color);
|
it.filled_triangle(x + cap, y + h, x, y + h - cap, x + w, y + h - cap, color);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user