mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
previewrender: do not overflow if ratio is greater than 1
Change-Id: Id7f443a354691d7b5b0a71e6e8b35a4cd0005a88 GitLab: #611
This commit is contained in:
parent
335b2e5f12
commit
9c0bba79b2
1 changed files with 2 additions and 2 deletions
|
@ -53,8 +53,8 @@ PreviewRenderer::paint(QPainter* painter)
|
|||
|
||||
auto aspectRatio = static_cast<qreal>(previewImage->width())
|
||||
/ static_cast<qreal>(previewImage->height());
|
||||
auto previewHeight = height();
|
||||
auto previewWidth = previewHeight * aspectRatio;
|
||||
auto previewHeight = aspectRatio < 1 ? height() : width() / aspectRatio;
|
||||
auto previewWidth = aspectRatio < 1 ? previewHeight * aspectRatio : width();
|
||||
|
||||
/* Instead of setting fixed size, we could get an x offset for the preview
|
||||
* but this would render the horizontal spacers in the parent widget useless.
|
||||
|
|
Loading…
Add table
Reference in a new issue