KShare/cropeditor/drawing/pathitem.cpp
ArsenArsen d10de26dec Make path brushes optional
It auto fills now which is ugly.
2017-06-28 19:01:52 +02:00

25 lines
645 B
C++

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