Formatting

This commit is contained in:
Dave Allie 2025-12-29 13:17:39 +11:00
parent 904c1f3f43
commit 78b3b8da23
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F
4 changed files with 5 additions and 5 deletions

View File

@ -7,7 +7,7 @@ void PageLine::render(GfxRenderer& renderer, const int fontId, const int xOffset
block->render(renderer, fontId, xPos + xOffset, yPos + yOffset);
}
bool PageLine::serialize(File &file) {
bool PageLine::serialize(File& file) {
serialization::writePod(file, xPos);
serialization::writePod(file, yPos);

View File

@ -18,7 +18,7 @@ class PageElement {
explicit PageElement(const int16_t xPos, const int16_t yPos) : xPos(xPos), yPos(yPos) {}
virtual ~PageElement() = default;
virtual void render(GfxRenderer& renderer, int fontId, int xOffset, int yOffset) = 0;
virtual bool serialize(File &file) = 0;
virtual bool serialize(File& file) = 0;
};
// a line from a block element
@ -29,7 +29,7 @@ class PageLine final : public PageElement {
PageLine(std::shared_ptr<TextBlock> block, const int16_t xPos, const int16_t yPos)
: PageElement(xPos, yPos), block(std::move(block)) {}
void render(GfxRenderer& renderer, int fontId, int xOffset, int yOffset) override;
bool serialize(File &file) override;
bool serialize(File& file) override;
static std::unique_ptr<PageLine> deserialize(File& file);
};

View File

@ -24,7 +24,7 @@ void TextBlock::render(const GfxRenderer& renderer, const int fontId, const int
}
}
bool TextBlock::serialize(File &file) const {
bool TextBlock::serialize(File& file) const {
if (words.size() != wordXpos.size() || words.size() != wordStyles.size()) {
Serial.printf("[%lu] [TXB] Serialization failed: size mismatch (words=%u, xpos=%u, styles=%u)\n", millis(),
words.size(), wordXpos.size(), wordStyles.size());

View File

@ -36,6 +36,6 @@ class TextBlock final : public Block {
// given a renderer works out where to break the words into lines
void render(const GfxRenderer& renderer, int fontId, int x, int y) const;
BlockType getType() override { return TEXT_BLOCK; }
bool serialize(File &file) const;
bool serialize(File& file) const;
static std::unique_ptr<TextBlock> deserialize(File& file);
};