From 9fd611e2d1c663e71efdb150dae49f4026ab99fc Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 28 Apr 2017 15:37:31 +0300 Subject: [PATCH] Fixed bug with a grainline. Grainline arrows were upside down on layout. --HG-- branch : release --- src/libs/vlayout/vlayoutpiece.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index f7224b82a..2ffb1fb27 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -564,14 +564,14 @@ void VLayoutPiece::SetGrainline(const VGrainlineData& geom, const VContainer* pa } QPointF pt2(pt1.x() + dLen * qCos(dAng), pt1.y() - dLen * qSin(dAng)); - QVector v; const qreal dArrowLen = ToPixel(0.5, *pattern->GetPatternUnit()); const qreal dArrowAng = M_PI/9; + QVector v; v << pt1; - if (geom.GetArrowType() != ArrowType::atRear) + if (geom.GetArrowType() != ArrowType::atFront) { v << QPointF(pt1.x() + dArrowLen * qCos(dAng + dArrowAng), pt1.y() - dArrowLen * qSin(dAng + dArrowAng)); v << QPointF(pt1.x() + dArrowLen * qCos(dAng - dArrowAng), pt1.y() - dArrowLen * qSin(dAng - dArrowAng)); @@ -580,7 +580,7 @@ void VLayoutPiece::SetGrainline(const VGrainlineData& geom, const VContainer* pa v << pt2; - if (geom.GetArrowType() != ArrowType::atFront) + if (geom.GetArrowType() != ArrowType::atRear) { dAng += M_PI; @@ -966,6 +966,7 @@ void VLayoutPiece::CreateGrainlineItem(QGraphicsItem *parent) const VGraphicsFillItem* item = new VGraphicsFillItem(parent); QPainterPath path; + QVector gPoints = Map(d->grainlinePoints); path.moveTo(gPoints.at(0)); for (int i = 1; i < gPoints.count(); ++i)