From 97bc0266c22d17cf6dc07d645c43631d35330a2d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 13 Jan 2024 08:33:22 +0200 Subject: [PATCH] Fix compatibility with Qt 5.6. --- src/libs/vlayout/vfoldline.cpp | 2 +- src/libs/vpatterndb/vpiece.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/vlayout/vfoldline.cpp b/src/libs/vlayout/vfoldline.cpp index 50cf7cb18..e1f4b9b5b 100644 --- a/src/libs/vlayout/vfoldline.cpp +++ b/src/libs/vlayout/vfoldline.cpp @@ -507,7 +507,7 @@ auto VFoldLine::TrueCenter(const QLineF &base, qreal width) const -> QPointF if (VFuzzyComparePossibleNulls(base.length(), width) || qFuzzyIsNull(width)) { - return base.center(); + return LineCenter(base); } QLineF seg1 = base; diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 6716c393a..ccb97bdff 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1680,8 +1680,8 @@ auto VPiece::SeamAllowanceMirrorLine(const VContainer *data) const -> QLineF QRectF rec = QRectF(0, 0, INT_MAX, INT_MAX); rec.translate(-INT_MAX / 2.0, -INT_MAX / 2.0); - QLineF axis = - QLineF(seamMirrorLine.center(), VGObject::BuildRay(seamMirrorLine.center(), seamMirrorLine.angle() + 180, rec)); + QLineF axis = QLineF(LineCenter(seamMirrorLine), + VGObject::BuildRay(LineCenter(seamMirrorLine), seamMirrorLine.angle() + 180, rec)); QVector points; CastTo(SeamAllowancePoints(data), points); @@ -1695,7 +1695,8 @@ auto VPiece::SeamAllowanceMirrorLine(const VContainer *data) const -> QLineF const QPointF startPoint = intersections.constFirst(); std::reverse(points.begin(), points.end()); - axis = QLineF(seamMirrorLine.center(), VGObject::BuildRay(seamMirrorLine.center(), seamMirrorLine.angle(), rec)); + axis = + QLineF(LineCenter(seamMirrorLine), VGObject::BuildRay(LineCenter(seamMirrorLine), seamMirrorLine.angle(), rec)); intersections = VAbstractCurve::CurveIntersectLine(points, axis); if (intersections.isEmpty()) {