![]() |
Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
|
Interactive crop surface showing how a playmat card art will appear across the combined table + stack play area. More...
#include <playmat_preview_widget.h>
Signals | |
| void | paramsEdited (const PlaymatParams ¶ms) |
| Emitted whenever direct manipulation (drag, wheel, keys) changes the crop parameters. | |
Public Member Functions | |
| PlaymatPreviewWidget (QWidget *parent=nullptr) | |
| void | setPixmap (const QPixmap &pixmap) |
| void | setParams (const PlaymatParams ¶ms) |
| void | setAttribution (const QString &attribution) |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | wheelEvent (QWheelEvent *event) override |
| void | keyPressEvent (QKeyEvent *event) override |
| void | focusInEvent (QFocusEvent *event) override |
Private Member Functions | |
| QRectF | activePlayArea () const |
| destination rect used for rendering AND gesture math | |
| qreal | samplingWindowSide () const |
| clamped square window side, shared with the render path | |
| qreal | widgetToSourceScale () const |
| void | applyCropDelta (qreal dMarginL, qreal dMarginR, qreal dOffset, qreal zoomFactor) |
| bool | sameCrop (const PlaymatParams &a, const PlaymatParams &b) const |
| void | restoreSnapshot () |
Private Attributes | |
| QPixmap | sourcePixmap |
| PlaymatParams | params |
| PlaymatParams | paramsAtFocusIn |
| crop as of the latest focus gain, restored by Esc or Backspace | |
| QString | attributionText |
| QPoint | lastDragPos |
| widget space position of the previous mouse move while panning | |
Interactive crop surface showing how a playmat card art will appear across the combined table + stack play area.
Renders a fixed frame shaped like a fresh board's stack+table area (the most generous framing the game produces): it shows the tallest slice of the square crop in normal play, with dimmed strips marking where a wider, developed table crops further, exactly the game's own render pipeline. The widget doubles as the editor's primary crop control: dragging pans the art behind the frame, the wheel zooms, and arrow keys nudge, mirroring the stored parameters (margins pan horizontally, verticalOffset vertically, zoom scales) so no separate numeric controls are needed.
|
explicit |
|
private |
destination rect used for rendering AND gesture math
|
private |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
signal |
Emitted whenever direct manipulation (drag, wheel, keys) changes the crop parameters.
|
private |
|
private |
|
private |
clamped square window side, shared with the render path
| void PlaymatPreviewWidget::setAttribution | ( | const QString & | attribution | ) |
| void PlaymatPreviewWidget::setParams | ( | const PlaymatParams & | params | ) |
| void PlaymatPreviewWidget::setPixmap | ( | const QPixmap & | pixmap | ) |
|
overrideprotected |
|
private |
|
private |
|
private |
widget space position of the previous mouse move while panning
|
private |
|
private |
crop as of the latest focus gain, restored by Esc or Backspace
|
private |