mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
format fix
This commit is contained in:
parent
f7a0c8ac65
commit
fff39db2dc
@ -5,7 +5,6 @@
|
|||||||
#include <GfxRenderer.h>
|
#include <GfxRenderer.h>
|
||||||
#include <SDCardManager.h>
|
#include <SDCardManager.h>
|
||||||
|
|
||||||
|
|
||||||
#include "CrossPointSettings.h"
|
#include "CrossPointSettings.h"
|
||||||
#include "CrossPointState.h"
|
#include "CrossPointState.h"
|
||||||
#include "EpubReaderChapterSelectionActivity.h"
|
#include "EpubReaderChapterSelectionActivity.h"
|
||||||
@ -281,9 +280,8 @@ void EpubReaderActivity::jumpToPercent(int percent) {
|
|||||||
const size_t cumulative = epub->getCumulativeSpineItemSize(targetSpineIndex);
|
const size_t cumulative = epub->getCumulativeSpineItemSize(targetSpineIndex);
|
||||||
const size_t spineSize = (cumulative > prevCumulative) ? (cumulative - prevCumulative) : 0;
|
const size_t spineSize = (cumulative > prevCumulative) ? (cumulative - prevCumulative) : 0;
|
||||||
// Store a normalized position within the spine so it can be applied once loaded.
|
// Store a normalized position within the spine so it can be applied once loaded.
|
||||||
pendingSpineProgress = (spineSize == 0) ? 0.0f
|
pendingSpineProgress =
|
||||||
: static_cast<float>(targetSize - prevCumulative) /
|
(spineSize == 0) ? 0.0f : static_cast<float>(targetSize - prevCumulative) / static_cast<float>(spineSize);
|
||||||
static_cast<float>(spineSize);
|
|
||||||
if (pendingSpineProgress < 0.0f) {
|
if (pendingSpineProgress < 0.0f) {
|
||||||
pendingSpineProgress = 0.0f;
|
pendingSpineProgress = 0.0f;
|
||||||
} else if (pendingSpineProgress > 1.0f) {
|
} else if (pendingSpineProgress > 1.0f) {
|
||||||
|
|||||||
@ -9,7 +9,7 @@ namespace {
|
|||||||
// Fine/coarse slider step sizes for percent adjustments.
|
// Fine/coarse slider step sizes for percent adjustments.
|
||||||
constexpr int kSmallStep = 1;
|
constexpr int kSmallStep = 1;
|
||||||
constexpr int kLargeStep = 10;
|
constexpr int kLargeStep = 10;
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
void EpubReaderPercentSelectionActivity::onEnter() {
|
void EpubReaderPercentSelectionActivity::onEnter() {
|
||||||
ActivityWithSubactivity::onEnter();
|
ActivityWithSubactivity::onEnter();
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include "activities/ActivityWithSubactivity.h"
|
|
||||||
#include "MappedInputManager.h"
|
#include "MappedInputManager.h"
|
||||||
|
#include "activities/ActivityWithSubactivity.h"
|
||||||
|
|
||||||
class EpubReaderPercentSelectionActivity final : public ActivityWithSubactivity {
|
class EpubReaderPercentSelectionActivity final : public ActivityWithSubactivity {
|
||||||
public:
|
public:
|
||||||
@ -24,17 +24,17 @@ class EpubReaderPercentSelectionActivity final : public ActivityWithSubactivity
|
|||||||
void loop() override;
|
void loop() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Current percent value (0-100) shown on the slider.
|
// Current percent value (0-100) shown on the slider.
|
||||||
int percent = 0;
|
int percent = 0;
|
||||||
// Render dirty flag for the task loop.
|
// Render dirty flag for the task loop.
|
||||||
bool updateRequired = false;
|
bool updateRequired = false;
|
||||||
// FreeRTOS task and mutex for rendering.
|
// FreeRTOS task and mutex for rendering.
|
||||||
TaskHandle_t displayTaskHandle = nullptr;
|
TaskHandle_t displayTaskHandle = nullptr;
|
||||||
SemaphoreHandle_t renderingMutex = 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;
|
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;
|
const std::function<void()> onCancel;
|
||||||
|
|
||||||
static void taskTrampoline(void* param);
|
static void taskTrampoline(void* param);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user