Skip to content

Commit

Permalink
FB2 cover: preserve original image aspect ratio (#604)
Browse files Browse the repository at this point in the history
Remove dubious code, so the cover aspect ratio is preserved,
the same way we do for ePubs and other file types.
  • Loading branch information
dmalinovsky authored Sep 27, 2024
1 parent 6e6a993 commit f9e9c3f
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 f9e9c3f

Please sign in to comment.