More pass by reference changes

This commit is contained in:
Dave Allie
2025-12-06 15:50:11 +11:00
parent 5ed2fe391d
commit 4ecfdea1a1
7 changed files with 42 additions and 37 deletions

View File

@@ -7,7 +7,7 @@
#define XteinkDisplay GxEPD2_BW<GxEPD2_426_GDEQ0426T82, GxEPD2_426_GDEQ0426T82::HEIGHT>
class EpdRenderer {
XteinkDisplay* display;
XteinkDisplay& display;
EpdFontRenderer<XteinkDisplay>* regularFontRenderer;
EpdFontRenderer<XteinkDisplay>* smallFontRenderer;
EpdFontRenderer<XteinkDisplay>* uiFontRenderer;
@@ -18,8 +18,8 @@ class EpdRenderer {
float lineCompression;
public:
explicit EpdRenderer(XteinkDisplay* display);
~EpdRenderer() = default;
explicit EpdRenderer(XteinkDisplay& display);
~EpdRenderer();
int getTextWidth(const char* text, EpdFontStyle style = REGULAR) const;
int getUiTextWidth(const char* text, EpdFontStyle style = REGULAR) const;
int getSmallTextWidth(const char* text, EpdFontStyle style = REGULAR) const;