A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Show indexing text when indexing

+17 -4
+1 -1
lib/EpdFontRenderer/EpdFontRenderer.hpp
··· 89 89 if (font->data->compressed) { 90 90 auto* tmpBitmap = static_cast<uint8_t*>(malloc(bitmapSize)); 91 91 if (tmpBitmap == nullptr && bitmapSize) { 92 - // ESP_LOGE("font", "malloc failed."); 92 + Serial.println("Failed to allocate memory for decompression buffer"); 93 93 return; 94 94 } 95 95
+2 -3
lib/EpdRenderer/EpdRenderer.cpp
··· 120 120 121 121 void EpdRenderer::flushDisplay(const bool partialUpdate) const { display->display(partialUpdate); } 122 122 123 - void EpdRenderer::flushArea(int x, int y, int width, int height) const { 124 - // TODO: Fix 125 - display->display(true); 123 + void EpdRenderer::flushArea(const int x, const int y, const int width, const int height) const { 124 + display->displayWindow(x, y, width, height); 126 125 } 127 126 128 127 int EpdRenderer::getPageWidth() const { return display->width() - marginLeft - marginRight; }
+14
src/screens/EpubReaderScreen.cpp
··· 123 123 section = new Section(epub, currentSpineIndex, renderer); 124 124 if (!section->hasCache()) { 125 125 Serial.println("Cache not found, building..."); 126 + 127 + { 128 + const int textWidth = renderer->getTextWidth("Indexing..."); 129 + constexpr int margin = 20; 130 + const int x = (renderer->getPageWidth() - textWidth - margin * 2) / 2; 131 + constexpr int y = 50; 132 + const int w = textWidth + margin * 2; 133 + const int h = renderer->getLineHeight() + margin * 2; 134 + renderer->fillRect(x, y, w, h, 0); 135 + renderer->drawText(x + margin, y + margin, "Indexing..."); 136 + renderer->drawRect(x + 5, y + 5, w - 10, h - 10, 1); 137 + renderer->flushArea(x - 20, y - 20, w + 40, h + 40); 138 + } 139 + 126 140 section->setupCacheDir(); 127 141 if (!section->persistPageDataToSD()) { 128 142 Serial.println("Failed to persist page data to SD");