Use reference passing for EpdRenderer

This commit is contained in:
Dave Allie
2025-12-06 12:56:39 +11:00
parent 6414f85257
commit 9a33030623
23 changed files with 109 additions and 114 deletions

View File

@@ -107,11 +107,11 @@ void Section::renderPage() {
delete p;
} else if (pageCount == 0) {
Serial.println("No pages to render");
const int width = renderer->getTextWidth("Empty chapter", BOLD);
renderer->drawText((renderer->getPageWidth() - width) / 2, 300, "Empty chapter", 1, BOLD);
const int width = renderer.getTextWidth("Empty chapter", BOLD);
renderer.drawText((renderer.getPageWidth() - width) / 2, 300, "Empty chapter", 1, BOLD);
} else {
Serial.printf("Page out of bounds: %d (max %d)\n", currentPage, pageCount);
const int width = renderer->getTextWidth("Out of bounds", BOLD);
renderer->drawText((renderer->getPageWidth() - width) / 2, 300, "Out of bounds", 1, BOLD);
const int width = renderer.getTextWidth("Out of bounds", BOLD);
renderer.drawText((renderer.getPageWidth() - width) / 2, 300, "Out of bounds", 1, BOLD);
}
}