Uniform separation of 7-segment display font elements.
This commit is contained in:
+18
-7
@@ -493,13 +493,24 @@ class Meter {
|
|||||||
}
|
}
|
||||||
int t = 10;
|
int t = 10;
|
||||||
int half = h / 2;
|
int half = h / 2;
|
||||||
if (a) this->draw_segment_(it, x + t / 2, y, w - t, t, true, color);
|
int gap = 1;
|
||||||
if (b) this->draw_segment_(it, x + w - t, y + t / 2, t, half - t, false, color);
|
|
||||||
if (c) this->draw_segment_(it, x + w - t, y + half + t / 2, t, half - t, false, color);
|
int top_y = y;
|
||||||
if (d) this->draw_segment_(it, x + t / 2, y + h - t, w - t, t, true, color);
|
int mid_y = y + half - t / 2;
|
||||||
if (e) this->draw_segment_(it, x, y + half + t / 2, t, half - t, false, color);
|
int bot_y = y + h - t;
|
||||||
if (f) this->draw_segment_(it, x, y + t / 2, t, half - t, false, color);
|
|
||||||
if (g) this->draw_segment_(it, x + t / 2, y + half - t / 2, w - t, t, true, color);
|
int upper_v_y = top_y + t + gap;
|
||||||
|
int upper_v_h = mid_y - gap - upper_v_y;
|
||||||
|
int lower_v_y = mid_y + t + gap;
|
||||||
|
int lower_v_h = bot_y - gap - lower_v_y;
|
||||||
|
|
||||||
|
if (a) this->draw_segment_(it, x + t / 2, top_y, w - t, t, true, color);
|
||||||
|
if (b && upper_v_h > 0) this->draw_segment_(it, x + w - t, upper_v_y, t, upper_v_h, false, color);
|
||||||
|
if (c && lower_v_h > 0) this->draw_segment_(it, x + w - t, lower_v_y, t, lower_v_h, false, color);
|
||||||
|
if (d) this->draw_segment_(it, x + t / 2, bot_y, w - t, t, true, color);
|
||||||
|
if (e && lower_v_h > 0) this->draw_segment_(it, x, lower_v_y, t, lower_v_h, false, color);
|
||||||
|
if (f && upper_v_h > 0) this->draw_segment_(it, x, upper_v_y, t, upper_v_h, false, color);
|
||||||
|
if (g) this->draw_segment_(it, x + t / 2, mid_y, w - t, t, true, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_bargraph_(Display &it, uint16_t digits, bool active) {
|
void draw_bargraph_(Display &it, uint16_t digits, bool active) {
|
||||||
|
|||||||
Reference in New Issue
Block a user