Skip to content

Commit

Permalink
Preserve FB2 cover aspect ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalinovsky authored Sep 27, 2024
1 parent 6e6a993 commit 21a73ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crengine/src/lvdocview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,9 @@ void LVDocView::drawCoverTo(LVDrawBuf * drawBuf, lvRect & rc) {
scale_x = scale_y;
int dst_dx = (src_dx * scale_x) >> 16;
int dst_dy = (src_dy * scale_y) >> 16;
if (dst_dx > rc.width() * 6 / 8)
if (dst_dx > rc.width())
dst_dx = imgrc.width();
if (dst_dy > rc.height() * 6 / 8)
if (dst_dy > rc.height())
dst_dy = imgrc.height();
//CRLog::trace("drawCoverTo() - drawing image");
LVColorDrawBuf buf2(src_dx, src_dy, 32);
Expand Down

0 comments on commit 21a73ba

Please sign in to comment.