Refactoring.

--HG--
branch : feature
This commit is contained in:
dismine 2014-03-06 15:35:14 +02:00
parent eba24ec34b
commit ab19b30713
2 changed files with 18 additions and 16 deletions

View File

@ -178,23 +178,24 @@ void VToolCutSpline::SplineChoosed(quint32 id)
void VToolCutSpline::ChangedActivDraw(const QString &newName)
{
bool flag = true;
if (nameActivDraw == newName)
{
currentColor = Qt::black;
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
firstSpline->setAcceptHoverEvents(true);
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
secondSpline->setAcceptHoverEvents(true);
flag = true;
}
else
{
currentColor = Qt::gray;
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
firstSpline->setAcceptHoverEvents(false);
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
secondSpline->setAcceptHoverEvents(false);
flag = false;
}
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
firstSpline->setAcceptHoverEvents(flag);
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
secondSpline->setAcceptHoverEvents(flag);
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
VToolPoint::ChangedActivDraw(newName);
}

View File

@ -259,23 +259,24 @@ void VToolCutSplinePath::SplineChoosed(quint32 id)
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
{
bool flag = true;
if (nameActivDraw == newName)
{
currentColor = Qt::black;
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
firstSpline->setAcceptHoverEvents(true);
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, true);
secondSpline->setAcceptHoverEvents(true);
flag = true;
}
else
{
currentColor = Qt::gray;
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
firstSpline->setAcceptHoverEvents(false);
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, false);
secondSpline->setAcceptHoverEvents(false);
flag = false;
}
firstSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
firstSpline->setAcceptHoverEvents(flag);
firstSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
secondSpline->setFlag(QGraphicsItem::ItemIsSelectable, flag);
secondSpline->setAcceptHoverEvents(flag);
secondSpline->setPen(QPen(currentColor, toPixel(widthHairLine)/factor));
VToolPoint::ChangedActivDraw(newName);
}