![]() |
Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
|
Functions | |
| qreal | playmatVisibleWidth (const QSize &fullCardSize, const PlaymatParams ¶ms) |
| Width of the outer viewing window: full card width trimmed by the horizontal margins. Guarded against margins summing to >= 1. | |
| qreal | playmatClampedZoom (const QSize &fullCardSize, const PlaymatParams ¶ms) |
| Zoom clamped to the range where every step renders differently. | |
| qreal | playmatWindowSide (const QSize &fullCardSize, const PlaymatParams ¶ms) |
| Side of the square sampling window actually rendered for these parameters. Never exceeds either card dimension, so the source rect always lies within the image (vertical travel remains for panning whenever the art is taller than it is wide). | |
| QRectF | computeArtSourceRect (const QSize &fullCardSize, const PlaymatParams ¶ms) |
| Computes the source region of the full resolution card image to use as a playmat. | |
| QRectF | coverFitRect (const QRectF &dstArea, const QSizeF &srcSize) |
| Returns the destination rectangle that fits a source of the given aspect ratio into dstArea using "cover" semantics (no distortion, overflows cropped). | |
| QRectF | aspectFitRect (const QRectF &dstArea, qreal aspect) |
| Fits a rectangle of the given aspect ratio into dstArea, centered, touching the constraining dimension ("aspect fit" of the FRAME itself, not of a source image). | |
Variables | |
| constexpr qreal | MAX_ZOOM = 4.0 |
| Upper bound for zooming into the playmat art. | |
|
inline |
Fits a rectangle of the given aspect ratio into dstArea, centered, touching the constraining dimension ("aspect fit" of the FRAME itself, not of a source image).
|
inline |
Computes the source region of the full resolution card image to use as a playmat.
Parameters are relative to the full card image. horizontal margins trim the card borders (shifting them pans the window), verticalOffset places the top edge of the sampling window within its available travel, and zoom scales into the trimmed span. The result always lies within the card image bounds.
| fullCardSize | Size of the full card image. |
| params | Positioning parameters. |
|
inline |
Returns the destination rectangle that fits a source of the given aspect ratio into dstArea using "cover" semantics (no distortion, overflows cropped).
| dstArea | Area to fill. |
| srcSize | Size of the source, only its aspect ratio matters. |
|
inline |
Zoom clamped to the range where every step renders differently.
The square sampling window is visibleWidth / zoom, zooming out past visibleWidth / min(card width, height) would sample beyond the card itself, which both looks broken and makes whole ranges of the parameter dead. The floor is therefore derived from the actual image instead of a static value, and is shared verbatim by the render path and the editor's gesture math so the two can never disagree.
|
inline |
Width of the outer viewing window: full card width trimmed by the horizontal margins. Guarded against margins summing to >= 1.
|
inline |
Side of the square sampling window actually rendered for these parameters. Never exceeds either card dimension, so the source rect always lies within the image (vertical travel remains for panning whenever the art is taller than it is wide).
|
constexpr |
Upper bound for zooming into the playmat art.