Enabling Show Curve Details option causes constant redraw.

This commit is contained in:
Roman Telezhynskyi 2021-02-24 14:46:28 +02:00
parent 97c91cae3e
commit 359735f034
5 changed files with 7 additions and 15 deletions

View File

@ -40,6 +40,7 @@
- Fix label size for case with two pins. - Fix label size for case with two pins.
- Fix crash while synchronize measurements. - Fix crash while synchronize measurements.
- Fix incorrect filename regular expressions. - Fix incorrect filename regular expressions.
- Enabling Show Curve Details option causes constant redraw.
# Version 0.6.1 October 23, 2018 # Version 0.6.1 October 23, 2018
- [#885] Regression. Broken support for multi size measurements. - [#885] Regression. Broken support for multi size measurements.

View File

@ -62,8 +62,7 @@ VAbstractSpline::VAbstractSpline(VAbstractPattern *doc, VContainer *data, quint3
sceneType(SceneObject::Unknown), sceneType(SceneObject::Unknown),
m_isHovered(false), m_isHovered(false),
detailsMode(qApp->Settings()->IsShowCurveDetails()), detailsMode(qApp->Settings()->IsShowCurveDetails()),
m_acceptHoverEvents(true), m_acceptHoverEvents(true)
m_parentRefresh(false)
{ {
InitDefShape(); InitDefShape();
setAcceptHoverEvents(m_acceptHoverEvents); setAcceptHoverEvents(m_acceptHoverEvents);
@ -123,17 +122,7 @@ void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
PaintWithFixItemHighlightSelected<QGraphicsPathItem>(this, painter, option, widget); PaintWithFixItemHighlightSelected<QGraphicsPathItem>(this, painter, option, widget);
}; };
if (not m_parentRefresh)
{
RefreshCtrlPoints();
m_parentRefresh = true;
PaintSpline(painter, option, widget); PaintSpline(painter, option, widget);
}
else
{
m_parentRefresh = false;
PaintSpline(painter, option, widget);
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -151,8 +151,6 @@ protected:
private: private:
Q_DISABLE_COPY(VAbstractSpline) Q_DISABLE_COPY(VAbstractSpline)
bool m_parentRefresh;
void InitDefShape(); void InitDefShape();
}; };

View File

@ -115,6 +115,8 @@ VToolSpline::VToolSpline(VToolSplineInitData initData, QGraphicsItem *parent)
static_cast<QPointF>(spl->GetP3()), freeAngle2, freeLength2, this); static_cast<QPointF>(spl->GetP3()), freeAngle2, freeLength2, this);
InitControlPoint(controlPoint2); InitControlPoint(controlPoint2);
VToolSpline::RefreshCtrlPoints();
ShowHandles(detailsMode); ShowHandles(detailsMode);
ToolCreation(initData.typeCreation); ToolCreation(initData.typeCreation);

View File

@ -126,6 +126,8 @@ VToolSplinePath::VToolSplinePath(const VToolSplinePathInitData &initData, QGraph
InitControlPoint(controlPoint); InitControlPoint(controlPoint);
} }
VToolSplinePath::RefreshCtrlPoints();
ShowHandles(detailsMode); ShowHandles(detailsMode);
ToolCreation(initData.typeCreation); ToolCreation(initData.typeCreation);