mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 23:57:39 +03:00
move to static cast and change range for wpm settings
This commit is contained in:
parent
81dd948a39
commit
38f0b9678d
@ -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;
|
||||
}
|
||||
|
||||
@ -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"}),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user