format fix

This commit is contained in:
Arthur Tazhitdinov 2026-02-02 18:55:57 +03:00
parent f7a0c8ac65
commit fff39db2dc
3 changed files with 9 additions and 11 deletions

View File

@ -5,7 +5,6 @@
#include <GfxRenderer.h>
#include <SDCardManager.h>
#include "CrossPointSettings.h"
#include "CrossPointState.h"
#include "EpubReaderChapterSelectionActivity.h"
@ -281,9 +280,8 @@ void EpubReaderActivity::jumpToPercent(int percent) {
const size_t cumulative = epub->getCumulativeSpineItemSize(targetSpineIndex);
const size_t spineSize = (cumulative > prevCumulative) ? (cumulative - prevCumulative) : 0;
// Store a normalized position within the spine so it can be applied once loaded.
pendingSpineProgress = (spineSize == 0) ? 0.0f
: static_cast<float>(targetSize - prevCumulative) /
static_cast<float>(spineSize);
pendingSpineProgress =
(spineSize == 0) ? 0.0f : static_cast<float>(targetSize - prevCumulative) / static_cast<float>(spineSize);
if (pendingSpineProgress < 0.0f) {
pendingSpineProgress = 0.0f;
} else if (pendingSpineProgress > 1.0f) {

View File

@ -9,7 +9,7 @@ namespace {
// Fine/coarse slider step sizes for percent adjustments.
constexpr int kSmallStep = 1;
constexpr int kLargeStep = 10;
}
} // namespace
void EpubReaderPercentSelectionActivity::onEnter() {
ActivityWithSubactivity::onEnter();

View File

@ -5,8 +5,8 @@
#include <functional>
#include "activities/ActivityWithSubactivity.h"
#include "MappedInputManager.h"
#include "activities/ActivityWithSubactivity.h"
class EpubReaderPercentSelectionActivity final : public ActivityWithSubactivity {
public:
@ -24,17 +24,17 @@ class EpubReaderPercentSelectionActivity final : public ActivityWithSubactivity
void loop() override;
private:
// Current percent value (0-100) shown on the slider.
// Current percent value (0-100) shown on the slider.
int percent = 0;
// Render dirty flag for the task loop.
// Render dirty flag for the task loop.
bool updateRequired = false;
// FreeRTOS task and mutex for rendering.
// FreeRTOS task and mutex for rendering.
TaskHandle_t displayTaskHandle = nullptr;
SemaphoreHandle_t renderingMutex = nullptr;
// Callback invoked when the user confirms a percent.
// Callback invoked when the user confirms a percent.
const std::function<void(int)> onSelect;
// Callback invoked when the user cancels the slider.
// Callback invoked when the user cancels the slider.
const std::function<void()> onCancel;
static void taskTrampoline(void* param);