mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-05 04:53:54 -07:00
prepareGeometryChange bugfix; more arrows code
This commit is contained in:
parent
961b42f734
commit
c57e138a78
13 changed files with 289 additions and 87 deletions
|
|
@ -11,14 +11,22 @@ class ArrowItem : public QObject, public QGraphicsItem {
|
|||
private:
|
||||
QPainterPath path;
|
||||
protected:
|
||||
QColor color;
|
||||
int id;
|
||||
CardItem *startItem, *targetItem;
|
||||
QColor color;
|
||||
bool fullColor;
|
||||
public:
|
||||
ArrowItem(CardItem *_startItem = 0, CardItem *_targetItem = 0);
|
||||
ArrowItem(int id, CardItem *_startItem = 0, CardItem *_targetItem = 0, const QColor &color = Qt::red);
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QRectF boundingRect() const { return path.boundingRect(); }
|
||||
void updatePath();
|
||||
void updatePath(const QPointF &endPoint);
|
||||
|
||||
int getId() const { return id; }
|
||||
void setStartItem(CardItem *_item) { startItem = _item; }
|
||||
void setTargetItem(CardItem *_item) { targetItem = _item; }
|
||||
CardItem *getStartItem() const { return startItem; }
|
||||
CardItem *getTargetItem() const { return targetItem; }
|
||||
};
|
||||
|
||||
class ArrowDragItem : public ArrowItem {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue