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.

Bump page file version

+10 -14
+1 -1
lib/Epub/Epub/EpubHtmlParserSlim.h
··· 28 28 int partWordBufferIndex = 0; 29 29 std::unique_ptr<ParsedText> currentTextBlock = nullptr; 30 30 std::unique_ptr<Page> currentPage = nullptr; 31 - int currentPageNextY = 0; 31 + int16_t currentPageNextY = 0; 32 32 int fontId; 33 33 float lineCompression; 34 34 int marginTop;
+4 -4
lib/Epub/Epub/Page.cpp
··· 3 3 #include <HardwareSerial.h> 4 4 #include <Serialization.h> 5 5 6 - constexpr uint8_t PAGE_FILE_VERSION = 2; 6 + constexpr uint8_t PAGE_FILE_VERSION = 3; 7 7 8 8 void PageLine::render(GfxRenderer& renderer, const int fontId) { block->render(renderer, fontId, xPos, yPos); } 9 9 ··· 16 16 } 17 17 18 18 std::unique_ptr<PageLine> PageLine::deserialize(std::istream& is) { 19 - int32_t xPos; 20 - int32_t yPos; 19 + int16_t xPos; 20 + int16_t yPos; 21 21 serialization::readPod(is, xPos); 22 22 serialization::readPod(is, yPos); 23 23 ··· 26 26 } 27 27 28 28 void Page::render(GfxRenderer& renderer, const int fontId) const { 29 - for (const auto element : elements) { 29 + for (auto& element : elements) { 30 30 element->render(renderer, fontId); 31 31 } 32 32 }
+4 -4
lib/Epub/Epub/Page.h
··· 11 11 // represents something that has been added to a page 12 12 class PageElement { 13 13 public: 14 - int xPos; 15 - int yPos; 16 - explicit PageElement(const int xPos, const int yPos) : xPos(xPos), yPos(yPos) {} 14 + int16_t xPos; 15 + int16_t yPos; 16 + explicit PageElement(const int16_t xPos, const int16_t yPos) : xPos(xPos), yPos(yPos) {} 17 17 virtual ~PageElement() = default; 18 18 virtual void render(GfxRenderer& renderer, int fontId) = 0; 19 19 virtual void serialize(std::ostream& os) = 0; ··· 24 24 std::shared_ptr<TextBlock> block; 25 25 26 26 public: 27 - PageLine(std::shared_ptr<TextBlock> block, const int xPos, const int yPos) 27 + PageLine(std::shared_ptr<TextBlock> block, const int16_t xPos, const int16_t yPos) 28 28 : PageElement(xPos, yPos), block(std::move(block)) {} 29 29 void render(GfxRenderer& renderer, int fontId) override; 30 30 void serialize(std::ostream& os) override;
+1 -5
src/main.cpp
··· 171 171 } 172 172 173 173 void setup() { 174 - // Begin serial only if USB connected 175 - pinMode(UART0_RXD, INPUT); 176 - if (digitalRead(UART0_RXD) == HIGH) { 177 - Serial.begin(115200); 178 - } 174 + Serial.begin(115200); 179 175 180 176 Serial.printf("[%lu] [ ] Starting CrossPoint version " CROSSPOINT_VERSION "\n", millis()); 181 177