From 8d68cde576149aaad4b50972d8fc98a8eea6f926 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 2 Jun 2020 16:35:40 +0300 Subject: [PATCH] Don't show null lines. smart-pattern/valentina#32. If both points, start and end, of a line are equal such a line is invalid. To avoid incorrect representation do not draw it. --- src/libs/vtools/visualization/visualization.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/vtools/visualization/visualization.cpp b/src/libs/vtools/visualization/visualization.cpp index b867dbbbd..9c75dc178 100644 --- a/src/libs/vtools/visualization/visualization.cpp +++ b/src/libs/vtools/visualization/visualization.cpp @@ -253,8 +253,12 @@ void Visualization::DrawLine(VScaledLine *lineItem, const QLineF &line, const QC visPen.setStyle(style); lineItem->setPen(visPen); - lineItem->setLine(line); - lineItem->setVisible(true); + if (not line.isNull()) + { + lineItem->setLine(line); + } + + lineItem->setVisible(not line.isNull()); } //---------------------------------------------------------------------------------------------------------------------