From f46c604bd238cfe964c9efb9dc824e0ede5ff370 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 24 Feb 2021 14:54:26 +0200 Subject: [PATCH] Enabling Show Curve Details option causes constant redraw. --- ChangeLog.txt | 2 ++ .../tools/drawTools/toolcurve/vabstractspline.cpp | 15 ++------------- .../tools/drawTools/toolcurve/vabstractspline.h | 2 -- .../tools/drawTools/toolcurve/vtoolspline.cpp | 2 ++ .../tools/drawTools/toolcurve/vtoolsplinepath.cpp | 2 ++ 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 338b15a19..653ecba6b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -3,6 +3,7 @@ - Fix regression with country flags. - Fix bug in seam allowance. - [smart-pattern/valentina#99] Incorrect fix of seam allowance distortion. +- Enabling Show Curve Details option causes constant redraw. # Version 0.7.44 Feb 9, 2021 - Placeholder %size% has incorrect value. @@ -165,6 +166,7 @@ - Fix label size for case with two pins. - Fix crash while synchronize measurements. - Fix incorrect filename regular expressions. +- Enabling Show Curve Details option causes constant redraw. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index 454ab86b9..7902830d9 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -63,8 +63,7 @@ VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint3 sceneType(SceneObject::Unknown), m_isHovered(false), detailsMode(VAbstractApplication::VApp()->Settings()->IsShowCurveDetails()), - m_acceptHoverEvents(true), - m_parentRefresh(false) + m_acceptHoverEvents(true) { InitDefShape(); setAcceptHoverEvents(m_acceptHoverEvents); @@ -125,17 +124,7 @@ void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *o PaintWithFixItemHighlightSelected(this, painter, option, widget); }; - if (not m_parentRefresh) - { - RefreshCtrlPoints(); - m_parentRefresh = true; - PaintSpline(painter, option, widget); - } - else - { - m_parentRefresh = false; - PaintSpline(painter, option, widget); - } + PaintSpline(painter, option, widget); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h index 6894ca666..feb920d6c 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.h @@ -159,8 +159,6 @@ protected: private: Q_DISABLE_COPY(VAbstractSpline) - bool m_parentRefresh; - void InitDefShape(); }; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 6613e1978..84b646ead 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -115,6 +115,8 @@ VToolSpline::VToolSpline(const VToolSplineInitData &initData, QGraphicsItem *par static_cast(spl->GetP3()), freeAngle2, freeLength2, this); InitControlPoint(controlPoint2); + VToolSpline::RefreshCtrlPoints(); + ShowHandles(detailsMode); ToolCreation(initData.typeCreation); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index dca3524d1..de573af14 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -150,6 +150,8 @@ VToolSplinePath::VToolSplinePath(const VToolSplinePathInitData &initData, QGraph InitControlPoint(controlPoint); } + VToolSplinePath::RefreshCtrlPoints(); + ShowHandles(detailsMode); ToolCreation(initData.typeCreation);