From d41aa30e109f030eea1c19f41a0bd31474db8b4e Mon Sep 17 00:00:00 2001 From: Zach H Date: Thu, 19 Dec 2024 01:03:48 -0500 Subject: [PATCH] Revert "Rotate split cards (#5264)" (#5269) This reverts commit a5c509981be115c656011e480c26377a94d89a61. --- .../cards/card_info_picture_widget.cpp | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/cockatrice/src/client/ui/widgets/cards/card_info_picture_widget.cpp b/cockatrice/src/client/ui/widgets/cards/card_info_picture_widget.cpp index f9d4d68bf..284660037 100644 --- a/cockatrice/src/client/ui/widgets/cards/card_info_picture_widget.cpp +++ b/cockatrice/src/client/ui/widgets/cards/card_info_picture_widget.cpp @@ -149,29 +149,15 @@ void CardInfoPictureWidget::paintEvent(QPaintEvent *event) loadPixmap(); } - QPixmap transformedPixmap = resizedPixmap; // Default pixmap - if (info && info->getLandscapeOrientation()) { - // Rotate pixmap 90 degrees to the left - QTransform transform; - transform.rotate(90); - transformedPixmap = resizedPixmap.transformed(transform, Qt::SmoothTransformation); - } - - // Adjust scaling after rotation - const QSize availableSize = size(); // Size of the widget - const QSize pixmapSize = transformedPixmap.size(); - const QSize scaledSize = pixmapSize.scaled(availableSize, Qt::KeepAspectRatio); - - const QPoint topLeft{(availableSize.width() - scaledSize.width()) / 2, - (availableSize.height() - scaledSize.height()) / 2}; + const QSize scaledSize = resizedPixmap.size().scaled(size(), Qt::KeepAspectRatio); + const QPoint topLeft{(width() - scaledSize.width()) / 2, (height() - scaledSize.height()) / 2}; const qreal radius = 0.05 * scaledSize.width(); QStylePainter painter(this); QPainterPath shape; shape.addRoundedRect(QRect(topLeft, scaledSize), radius, radius); painter.setClipPath(shape); - painter.drawItemPixmap(QRect(topLeft, scaledSize), Qt::AlignCenter, - transformedPixmap.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + painter.drawItemPixmap(QRect(topLeft, scaledSize), Qt::AlignCenter, resizedPixmap); } /**