Fix radius node point in detail.

--HG--
branch : develop
This commit is contained in:
dismine 2014-06-10 16:14:21 +03:00
parent f5bad50bc3
commit 73b29b972c
2 changed files with 3 additions and 17 deletions

View File

@ -37,22 +37,7 @@ const QString VToolPoint::TagName = QStringLiteral("point");
VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent):VDrawTool(doc, data, id), VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent):VDrawTool(doc, data, id),
QGraphicsEllipseItem(parent), radius(DefRadius), namePoint(0), lineName(0) QGraphicsEllipseItem(parent), radius(DefRadius), namePoint(0), lineName(0)
{ {
switch (qApp->patternUnit()) radius = (DefRadius/*mm*/ / 25.4) * VApplication::PrintDPI;
{
case Valentina::Mm:
radius = qApp->toPixel(DefRadius);
break;
case Valentina::Cm:
radius = qApp->toPixel(DefRadius/10.0);
break;
case Valentina::Inch:
radius = qApp->toPixel(DefRadius/25.4);
break;
default:
radius = qApp->toPixel(DefRadius);
break;
}
namePoint = new VGraphicsSimpleTextItem(this); namePoint = new VGraphicsSimpleTextItem(this);
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu); connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu);
namePoint->setBrush(Qt::black); namePoint->setBrush(Qt::black);

View File

@ -38,9 +38,10 @@ const QString VNodePoint::ToolType = QStringLiteral("modeling");
VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint, VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent, const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
QGraphicsItem *parent) QGraphicsItem *parent)
:VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(qApp->toPixel(1.5)), :VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(0),
namePoint(nullptr), lineName(nullptr) namePoint(nullptr), lineName(nullptr)
{ {
radius = (1.5/*mm*/ / 25.4) * VApplication::PrintDPI;
namePoint = new VGraphicsSimpleTextItem(this); namePoint = new VGraphicsSimpleTextItem(this);
lineName = new QGraphicsLineItem(this); lineName = new QGraphicsLineItem(this);
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this,