Дисплей

This commit is contained in:
Кобелев Андрей Андреевич
2026-03-12 00:40:06 +03:00
parent a111352dc5
commit 6253480f30
16 changed files with 400 additions and 58 deletions

View File

@@ -12,13 +12,18 @@ struct BatteryProps {
class BatteryView {
public:
void layout(int screen_width, int screen_height);
void render(uint8_t* framebuffer, const BatteryProps& props) const;
EpdRect dirty_bounds(const BatteryProps& props, int pad_x = 4, int pad_y = 4) const;
void render(uint8_t* framebuffer, const BatteryProps& props);
const EpdRect& bounds() const;
private:
EpdRect measure_text_bounds(const BatteryProps& props) const;
EpdRect bounds_ = {0, 0, 0, 0};
int text_x_ = 0;
int text_y_ = 0;
EpdRect last_text_bounds_ = {0, 0, 0, 0};
bool has_last_text_bounds_ = false;
};
} // namespace ui