KShare/cropeditor/drawing/pathitem.cpp
2017-07-08 21:40:09 +02:00

25 lines
664 B
C++

#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 *) {
}