![]() |
Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
|
#include "art_crop_attribution.h"#include <QFontMetrics>#include <QObject>#include <QPainter>#include <libcockatrice/card/printing/exact_card.h>Functions | |
| QString | buildArtAttribution (const ExactCard &card) |
| Builds an attribution caption for a cropped card art display. | |
| QRectF | paintArtAttribution (QPainter &painter, const QRectF &rect, const QString &attribution, Qt::Alignment anchor, qreal scale) |
| Paints an attribution caption in a corner of a rect. | |
| QString buildArtAttribution | ( | const ExactCard & | card | ) |
Builds an attribution caption for a cropped card art display.
When a card image's art region is shown cropped (an "art crop"), the artist should be credited in the same interface. Returns an empty string when the database has no artist data for the card.
| card | The card whose art is being displayed. |
| QRectF paintArtAttribution | ( | QPainter & | painter, |
| const QRectF & | rect, | ||
| const QString & | attribution, | ||
| Qt::Alignment | anchor = Qt::AlignRight|Qt::AlignBottom, | ||
| qreal | scale = 1.0 ) |
Paints an attribution caption in a corner of a rect.
Draws a subtle semi-transparent pill containing the caption, elided to fit.
| painter | Painter to draw with. |
| rect | The area (e.g. the cropped art region) the caption belongs to. |
| attribution | Caption text (see buildArtAttribution()). |
| anchor | Corner of rect to pin the pill to (default bottom-right). |
| scale | Size multiplier for the pill (e.g. 0.8 for a smaller pill). |
attribution is empty.