mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-07 08:07:40 +03:00
move to static cast and change range for wpm settings
This commit is contained in:
parent
81dd948a39
commit
38f0b9678d
@ -34,11 +34,10 @@ void Page::render(GfxRenderer& renderer, const int fontId, const int xOffset, co
|
|||||||
size_t Page::wordCount() const {
|
size_t Page::wordCount() const {
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
for (const auto& element : elements) {
|
for (const auto& element : elements) {
|
||||||
const auto* line = dynamic_cast<PageLine*>(element.get());
|
// Only PageLine is stored in elements; avoid RTTI to stay compatible with -fno-rtti
|
||||||
if (line) {
|
const auto* line = static_cast<PageLine*>(element.get());
|
||||||
count += line->wordCount();
|
count += line->wordCount();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@ const SettingInfo settingsList[settingsCount] = {
|
|||||||
SettingInfo::Value("Reader Screen Margin", &CrossPointSettings::screenMargin, {5, 40, 5}),
|
SettingInfo::Value("Reader Screen Margin", &CrossPointSettings::screenMargin, {5, 40, 5}),
|
||||||
SettingInfo::Enum("Reader Paragraph Alignment", &CrossPointSettings::paragraphAlignment,
|
SettingInfo::Enum("Reader Paragraph Alignment", &CrossPointSettings::paragraphAlignment,
|
||||||
{"Justify", "Left", "Center", "Right"}),
|
{"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::Toggle("Show Time Left", &CrossPointSettings::showTimeLeftInChapter),
|
||||||
SettingInfo::Enum("Time to Sleep", &CrossPointSettings::sleepTimeout,
|
SettingInfo::Enum("Time to Sleep", &CrossPointSettings::sleepTimeout,
|
||||||
{"1 min", "5 min", "10 min", "15 min", "30 min"}),
|
{"1 min", "5 min", "10 min", "15 min", "30 min"}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user