Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish pending move operation before deleting item. Fixes issue #3697 #3703

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Finish pending move operation before deleting item. Fixes issue #3697
  • Loading branch information
KjellMorgenstern committed Aug 13, 2020
commit 6e6614dfc73767d24cb174fda9ecef6dafed7209
15 changes: 5 additions & 10 deletions src/sketch/sketchwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,8 @@ void SketchWidget::deleteItem(ItemBase * itemBase, bool deleteModelPart, bool do
}

void SketchWidget::deleteSelected(Wire * wire, bool minus) {
checkMoved(false);

QSet<ItemBase *> itemBases;
if (wire) {
itemBases << wire;
Expand Down Expand Up @@ -1981,8 +1983,6 @@ void SketchWidget::dropEvent(QDropEvent *event)
if (event->source() == this) {
// Item was dragged from this same window/view
checkMoved(false);
m_savedItems.clear();
m_savedWires.clear();
}
else {
// Item was dragged from another window
Expand Down Expand Up @@ -3401,6 +3401,8 @@ bool SketchWidget::checkMoved(bool wait)
m_undoStack->push(parentCommand);
}

m_savedItems.clear();
m_savedWires.clear();
return true;
}

Expand Down Expand Up @@ -5064,10 +5066,7 @@ void SketchWidget::keyReleaseEvent(QKeyEvent * event) {

void SketchWidget::arrowTimerTimeout() {
m_movingByArrow = false;
if (checkMoved(false)) {
m_savedItems.clear();
m_savedWires.clear();
}
checkMoved(false);
}

void SketchWidget::keyPressEvent ( QKeyEvent * event ) {
Expand Down Expand Up @@ -9625,8 +9624,6 @@ void SketchWidget::moveItem(ItemBase * itemBase, double x, double y)

m_movingByArrow = false;
checkMoved(false);
m_savedItems.clear();
m_savedWires.clear();
m_alignToGrid = alignToGrid;
}

Expand Down Expand Up @@ -9779,8 +9776,6 @@ void SketchWidget::alignItems(Qt::Alignment alignment) {
m_movingByArrow = false;
m_moveEventCount++;
checkMoved(false);
m_savedItems.clear();
m_savedWires.clear();
}

void SketchWidget::squashShapes(QPointF scenePos)
Expand Down