mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
clang format fix
This commit is contained in:
parent
2a94648828
commit
2b6927f083
@ -255,8 +255,7 @@ void EpubReaderActivity::jumpToPercent(int percent) {
|
|||||||
// Convert percent into a byte-like absolute position across the spine sizes.
|
// Convert percent into a byte-like absolute position across the spine sizes.
|
||||||
// Use an overflow-safe computation: (bookSize / 100) * percent + (bookSize % 100) * percent / 100
|
// Use an overflow-safe computation: (bookSize / 100) * percent + (bookSize % 100) * percent / 100
|
||||||
size_t targetSize =
|
size_t targetSize =
|
||||||
(bookSize / 100) * static_cast<size_t>(percent) +
|
(bookSize / 100) * static_cast<size_t>(percent) + (bookSize % 100) * static_cast<size_t>(percent) / 100;
|
||||||
(bookSize % 100) * static_cast<size_t>(percent) / 100;
|
|
||||||
if (percent >= 100) {
|
if (percent >= 100) {
|
||||||
// Ensure the final percent lands inside the last spine item.
|
// Ensure the final percent lands inside the last spine item.
|
||||||
targetSize = bookSize - 1;
|
targetSize = bookSize - 1;
|
||||||
|
|||||||
@ -106,14 +106,14 @@ void EpubReaderPercentSelectionActivity::renderScreen() {
|
|||||||
renderer.drawCenteredText(UI_12_FONT_ID, 15, "Go to Position", true, EpdFontFamily::BOLD);
|
renderer.drawCenteredText(UI_12_FONT_ID, 15, "Go to Position", true, EpdFontFamily::BOLD);
|
||||||
|
|
||||||
const std::string percentText = std::to_string(percent) + "%";
|
const std::string percentText = std::to_string(percent) + "%";
|
||||||
renderer.drawCenteredText(UI_12_FONT_ID, 70, percentText.c_str(), true, EpdFontFamily::BOLD);
|
renderer.drawCenteredText(UI_12_FONT_ID, 90, percentText.c_str(), true, EpdFontFamily::BOLD);
|
||||||
|
|
||||||
// Draw slider track.
|
// Draw slider track.
|
||||||
const int screenWidth = renderer.getScreenWidth();
|
const int screenWidth = renderer.getScreenWidth();
|
||||||
constexpr int barWidth = 360;
|
constexpr int barWidth = 360;
|
||||||
constexpr int barHeight = 16;
|
constexpr int barHeight = 16;
|
||||||
const int barX = (screenWidth - barWidth) / 2;
|
const int barX = (screenWidth - barWidth) / 2;
|
||||||
const int barY = 120;
|
const int barY = 140;
|
||||||
|
|
||||||
renderer.drawRect(barX, barY, barWidth, barHeight);
|
renderer.drawRect(barX, barY, barWidth, barHeight);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user