You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
664 B
25 lines
664 B
5 years ago
|
#include "pathitem.hpp"
|
||
|
|
||
5 years ago
|
#include <settings.hpp>
|
||
|
|
||
5 years ago
|
PathItem::PathItem() {
|
||
|
}
|
||
5 years ago
|
|
||
5 years ago
|
PathItem::~PathItem() {
|
||
|
delete path;
|
||
|
}
|
||
5 years ago
|
|
||
5 years ago
|
void PathItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) {
|
||
5 years ago
|
if (path == nullptr) {
|
||
5 years ago
|
path = new QPainterPath(scene->cursorPosition());
|
||
5 years ago
|
pathItem = scene->addPath(*path, scene->pen(),
|
||
|
settings::settings().value("brushPath", false).toBool() ? scene->brush() : QBrush());
|
||
5 years ago
|
} else {
|
||
5 years ago
|
path->quadTo(path->currentPosition(), scene->cursorPosition());
|
||
5 years ago
|
pathItem->setPath(*path);
|
||
|
}
|
||
5 years ago
|
}
|
||
|
|
||
5 years ago
|
void PathItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) {
|
||
|
}
|