mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 07:07:38 +03:00
Fix: moved loadFontsFromSd to occur on exit from settings
This fixes a bug where the loaded IDs do not exist in accessible memory if a user only changes font size in settings with a custom font defined; as a result, re-entering a book would rerender it with the correct size but the default font.
This commit is contained in:
parent
974b7f28b7
commit
fcdb4db2fe
@ -76,9 +76,6 @@ void FontSelectionActivity::saveAndExit() {
|
|||||||
SETTINGS.customFontFamily[sizeof(SETTINGS.customFontFamily) - 1] = '\0';
|
SETTINGS.customFontFamily[sizeof(SETTINGS.customFontFamily) - 1] = '\0';
|
||||||
SETTINGS.fontFamily = CrossPointSettings::FONT_CUSTOM;
|
SETTINGS.fontFamily = CrossPointSettings::FONT_CUSTOM;
|
||||||
SETTINGS.saveToFile();
|
SETTINGS.saveToFile();
|
||||||
|
|
||||||
// Reload fonts to make sure the newly selected font is loaded
|
|
||||||
EpdFontLoader::loadFontsFromSd(renderer);
|
|
||||||
}
|
}
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
@ -119,5 +116,9 @@ void FontSelectionActivity::render() const {
|
|||||||
y += 30;
|
y += 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw help text
|
||||||
|
const auto labels = mappedInput.mapLabels("« Back", "Select", "", "");
|
||||||
|
renderer.drawButtonHints(UI_10_FONT_ID, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
|
||||||
|
|
||||||
renderer.displayBuffer();
|
renderer.displayBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,6 +105,8 @@ void SettingsActivity::loop() {
|
|||||||
|
|
||||||
if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
||||||
SETTINGS.saveToFile();
|
SETTINGS.saveToFile();
|
||||||
|
// Reload fonts to make sure the newly selected font settings are loaded
|
||||||
|
EpdFontLoader::loadFontsFromSd(renderer);
|
||||||
onGoHome();
|
onGoHome();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user