style: fix formatting issues

This commit is contained in:
pablohc 2026-01-26 14:21:50 +01:00
parent 6d6559022c
commit 85b7e8124d
2 changed files with 3 additions and 5 deletions

View File

@ -421,7 +421,6 @@ bool Epub::generateCoverBmp(bool cropped) const {
std::string Epub::getCoverHomeBmpPath() const { return cachePath + "/cover_home.bmp"; } std::string Epub::getCoverHomeBmpPath() const { return cachePath + "/cover_home.bmp"; }
bool Epub::generateCoverHomeBmp() const { bool Epub::generateCoverHomeBmp() const {
// Already generated, return true // Already generated, return true
if (SdMan.exists(getCoverHomeBmpPath().c_str())) { if (SdMan.exists(getCoverHomeBmpPath().c_str())) {
@ -485,8 +484,7 @@ bool Epub::generateCoverHomeBmp() const {
const int targetWidth = (400 * jpegWidth) / jpegHeight; const int targetWidth = (400 * jpegWidth) / jpegHeight;
const bool success = const bool success =
JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, homeBmp, targetWidth, JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, homeBmp, targetWidth, HOME_TARGET_HEIGHT);
HOME_TARGET_HEIGHT);
coverJpg.close(); coverJpg.close();
homeBmp.close(); homeBmp.close();
SdMan.remove(coverJpgTempPath.c_str()); SdMan.remove(coverJpgTempPath.c_str());

View File

@ -239,8 +239,8 @@ void HomeActivity::render() {
// Use 400px height as specified, with proportional width // Use 400px height as specified, with proportional width
constexpr int CARD_HEIGHT = 400; constexpr int CARD_HEIGHT = 400;
const int cardWidth = (coverWidth > 0 && coverHeight > 0) const int cardWidth = (coverWidth > 0 && coverHeight > 0)
? (CARD_HEIGHT * coverWidth) / coverHeight ? (CARD_HEIGHT * coverWidth) / coverHeight
: 240; // Fallback to 240px width if no image (maintain aspect ratio) : 240; // Fallback to 240px width if no image (maintain aspect ratio)
const int bookX = (pageWidth - cardWidth) / 2; const int bookX = (pageWidth - cardWidth) / 2;
constexpr int bookY = 30; constexpr int bookY = 30;