Fix Valentina crash.

Valentina crashes if click on curve control point.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-07-25 21:56:01 +03:00
parent 99de6f8e22
commit 4d7d2ac607
2 changed files with 4 additions and 4 deletions

View File

@ -170,10 +170,10 @@ enum class Vis : ToolVisHolderType
{ {
ControlPointSpline = static_cast<ToolVisHolderType>(Tool::LAST_ONE_DO_NOT_USE), ControlPointSpline = static_cast<ToolVisHolderType>(Tool::LAST_ONE_DO_NOT_USE),
GraphicsSimpleTextItem, GraphicsSimpleTextItem,
ScaledLine,
ScaledEllipse,
SimplePoint, SimplePoint,
SimpleCurve, SimpleCurve,
ScaledLine,
ScaledEllipse,
Line, Line,
Path, Path,
Operation, Operation,

View File

@ -445,8 +445,8 @@ void VMainGraphicsView::mousePressEvent(QMouseEvent *event)
{ {
if (this->scene()->items().contains(list.at(i))) if (this->scene()->items().contains(list.at(i)))
{ {
if (list.at(i)->type() <= VSimpleCurve::Type && if (list.at(i)->type() > QGraphicsItem::UserType &&
list.at(i)->type() > QGraphicsItem::UserType) list.at(i)->type() <= VSimpleCurve::Type)
{ {
emit itemClicked(list.at(i)); emit itemClicked(list.at(i));
break; break;