Fix Abandon Edit

This commit is contained in:
wandererfan
2019-05-29 18:21:35 -04:00
committed by WandererFan
parent 74737f71fd
commit be257182ba
2 changed files with 10 additions and 1 deletions

View File

@@ -252,6 +252,11 @@ void QGEPath::restoreState()
{
// Base::Console().Message("QGEPath::restoreState()\n");
inEdit(false);
if (m_ghost != nullptr) {
if (m_ghost->scene() != nullptr) {
scene()->removeItem(m_ghost); //stop ghost from messing up brect
}
}
m_deltas = m_saveDeltas;
updatePath();
}

View File

@@ -265,6 +265,7 @@ void QGILeaderLine::startPathEdit(void)
void QGILeaderLine::saveState(void)
{
// Base::Console().Message("QGILL::saveState()\n");
auto leadFeat = getFeature();
if (leadFeat != nullptr) {
m_savePoints = leadFeat->WayPoints.getValues();
@@ -275,11 +276,13 @@ void QGILeaderLine::saveState(void)
void QGILeaderLine::restoreState(void)
{
// Base::Console().Message("QGILL::restoreState()\n");
auto leadFeat = getFeature();
if (leadFeat != nullptr) {
leadFeat->WayPoints.setValues(m_savePoints);
leadFeat->X.setValue(m_saveX);
leadFeat->Y.setValue(m_saveY);
leadFeat->recomputeFeature();
}
}
@@ -487,9 +490,10 @@ void QGILeaderLine::setArrows(std::vector<QPointF> pathPoints)
void QGILeaderLine::abandonEdit(void)
{
//// Base::Console().Message("QGIL::abandonEdit()\n");
// Base::Console().Message("QGIL::abandonEdit()\n");
m_line->clearMarkers();
m_line->restoreState();
restoreState();
}
double QGILeaderLine::getScale(void)