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.
 
 
 
 
 

24 lines
664 B

#include "pathitem.hpp"
#include <settings.hpp>
PathItem::PathItem() {
}
PathItem::~PathItem() {
delete path;
}
void PathItem::mouseDragEvent(QGraphicsSceneMouseEvent *, CropScene *scene) {
if (path == nullptr) {
path = new QPainterPath(scene->cursorPosition());
pathItem = scene->addPath(*path, scene->pen(),
settings::settings().value("brushPath", false).toBool() ? scene->brush() : QBrush());
} else {
path->quadTo(path->currentPosition(), scene->cursorPosition());
pathItem->setPath(*path);
}
}
void PathItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) {
}