From 4d7d2ac607746dc5323672b20bdc36ef2f494d90 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 25 Jul 2017 21:56:01 +0300 Subject: [PATCH] Fix Valentina crash. Valentina crashes if click on curve control point. --HG-- branch : develop --- src/libs/vmisc/def.h | 4 ++-- src/libs/vwidgets/vmaingraphicsview.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 29628a6e0..64a4cbd3d 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -170,10 +170,10 @@ enum class Vis : ToolVisHolderType { ControlPointSpline = static_cast(Tool::LAST_ONE_DO_NOT_USE), GraphicsSimpleTextItem, - ScaledLine, - ScaledEllipse, SimplePoint, SimpleCurve, + ScaledLine, + ScaledEllipse, Line, Path, Operation, diff --git a/src/libs/vwidgets/vmaingraphicsview.cpp b/src/libs/vwidgets/vmaingraphicsview.cpp index 31c5bac99..52d759e22 100644 --- a/src/libs/vwidgets/vmaingraphicsview.cpp +++ b/src/libs/vwidgets/vmaingraphicsview.cpp @@ -445,8 +445,8 @@ void VMainGraphicsView::mousePressEvent(QMouseEvent *event) { if (this->scene()->items().contains(list.at(i))) { - if (list.at(i)->type() <= VSimpleCurve::Type && - list.at(i)->type() > QGraphicsItem::UserType) + if (list.at(i)->type() > QGraphicsItem::UserType && + list.at(i)->type() <= VSimpleCurve::Type) { emit itemClicked(list.at(i)); break;