KShare/src/cropeditor/drawing/pathitem.cpp

25 lines
664 B
C++
Raw Normal View History

2017-05-01 18:43:54 +02:00
#include "pathitem.hpp"
#include <settings.hpp>
PathItem::PathItem() {
}
2017-05-01 18:43:54 +02:00
PathItem::~PathItem() {
delete path;
}
2017-05-01 18:43:54 +02:00
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);
}
2017-05-01 18:43:54 +02:00
}
void PathItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *) {
}