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 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.

View File

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

View File

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

View File

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

View File

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