move to static cast and change range for wpm settings

This commit is contained in:
Matthijs Mars 2026-01-09 14:22:26 +01:00
parent 81dd948a39
commit 38f0b9678d
2 changed files with 4 additions and 5 deletions

View File

@ -34,10 +34,9 @@ void Page::render(GfxRenderer& renderer, const int fontId, const int xOffset, co
size_t Page::wordCount() const {
size_t count = 0;
for (const auto& element : elements) {
const auto* line = dynamic_cast<PageLine*>(element.get());
if (line) {
count += line->wordCount();
}
// Only PageLine is stored in elements; avoid RTTI to stay compatible with -fno-rtti
const auto* line = static_cast<PageLine*>(element.get());
count += line->wordCount();
}
return count;
}

View File

@ -35,7 +35,7 @@ const SettingInfo settingsList[settingsCount] = {
SettingInfo::Value("Reader Screen Margin", &CrossPointSettings::screenMargin, {5, 40, 5}),
SettingInfo::Enum("Reader Paragraph Alignment", &CrossPointSettings::paragraphAlignment,
{"Justify", "Left", "Center", "Right"}),
SettingInfo::Value("Reading Speed (WPM)", &CrossPointSettings::readingSpeedWpm, {80, 240, 10}),
SettingInfo::Value("Reading Speed (WPM)", &CrossPointSettings::readingSpeedWpm, {150, 300, 10}),
SettingInfo::Toggle("Show Time Left", &CrossPointSettings::showTimeLeftInChapter),
SettingInfo::Enum("Time to Sleep", &CrossPointSettings::sleepTimeout,
{"1 min", "5 min", "10 min", "15 min", "30 min"}),