KShare/cropeditor/drawing/lineitem.cpp
ArsenArsen ae46699b95 Blur!
2017-05-01 11:29:35 +02:00

29 lines
529 B
C++

#include "lineitem.hpp"
LineItem::LineItem()
{
}
LineItem::~LineItem()
{
delete path;
}
void LineItem::mouseDragEvent(QGraphicsSceneMouseEvent *e, CropScene *scene)
{
if (path == nullptr)
{
path = new QPainterPath(e->scenePos());
pathItem = scene->addPath(*path, scene->pen(), scene->brush());
}
else
{
path->quadTo(path->currentPosition(), e->scenePos());
pathItem->setPath(*path);
}
}
void LineItem::mouseDragEndEvent(QGraphicsSceneMouseEvent *, CropScene *)
{
}