mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
style: fix formatting issues
This commit is contained in:
parent
6d6559022c
commit
85b7e8124d
@ -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());
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user