mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-24 02:13:02 -07:00
Use the landscape orientation flag to rotate sideways-layout card art upright before cropping, so planes/sieges show their horizontal art as the server profile banner card instead of a rotated full card. - Curve cropCardArt around the card's landscapeOrientation flag with landscape-specific art margins (mirrors CardInfoPictureWidget) - Add shared CardArtUtils::rotateSidewaysLayoutArt helper and apply it to the playmat (game render and settings preview) and card info widget, replacing three duplicate 90-degree rotation blocks
25 lines
No EOL
801 B
C++
25 lines
No EOL
801 B
C++
#ifndef CARD_ART_UTILS_H
|
|
#define CARD_ART_UTILS_H
|
|
|
|
#include <QPixmap>
|
|
|
|
class ExactCard;
|
|
|
|
namespace CardArtUtils
|
|
{
|
|
/**
|
|
* @brief Rotates a card's art upright when its layout shows sideways.
|
|
*
|
|
* Sideways-layout cards (planes, sieges/battles, split cards) store their
|
|
* landscape artwork rotated 90° inside a portrait frame. Art-crop displays,
|
|
* playmat art, and the card-info picture must show such art upright before
|
|
* sampling or painting. Portrait cards are returned unchanged.
|
|
*
|
|
* @param art The card pixmap to orient.
|
|
* @param card The card describing the art orientation.
|
|
* @return @p art rotated 90° clockwise for sideways-layout cards, else @p art.
|
|
*/
|
|
QPixmap rotateSidewaysLayoutArt(const QPixmap &art, const ExactCard &card);
|
|
} // namespace CardArtUtils
|
|
|
|
#endif // CARD_ART_UTILS_H
|