diff --git a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h index 5f404eec30..00a3542365 100644 --- a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h +++ b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h @@ -101,6 +101,7 @@ class TWO_D_MODEL_EXPORT TwoDModelWidget : public QWidget void setBackgroundMode(); void bringToFront(); + void resetDrawAction(); QString editorId() const override; bool supportsZooming() const override; diff --git a/plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp b/plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp index f3ace55565..929d430ebb 100644 --- a/plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp +++ b/plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp @@ -119,9 +119,11 @@ QPainterPath BallItem::shape() const void BallItem::saveStartPosition() { - mStartPosition = pos(); - mStartRotation = rotation(); - emit x1Changed(x1()); + if (this->editable()) { + mStartPosition = pos(); + mStartRotation = rotation(); + emit x1Changed(x1()); + } } void BallItem::returnToStartPosition() diff --git a/plugins/robots/common/twoDModel/src/engine/items/skittleItem.cpp b/plugins/robots/common/twoDModel/src/engine/items/skittleItem.cpp index db6540a44a..29cbdb403d 100644 --- a/plugins/robots/common/twoDModel/src/engine/items/skittleItem.cpp +++ b/plugins/robots/common/twoDModel/src/engine/items/skittleItem.cpp @@ -112,9 +112,11 @@ void SkittleItem::deserialize(const QDomElement &element) void SkittleItem::saveStartPosition() { - mStartPosition = pos(); - mStartRotation = rotation(); - emit x1Changed(x1()); + if (this->editable()) { + mStartPosition = pos(); + mStartRotation = rotation(); + emit x1Changed(x1()); + } } void SkittleItem::returnToStartPosition() diff --git a/plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp b/plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp index c5977fff37..4b5f91a154 100644 --- a/plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp +++ b/plugins/robots/common/twoDModel/src/engine/twoDModelEngineFacade.cpp @@ -89,6 +89,7 @@ void TwoDModelEngineFacade::init(const kitBase::EventsForKitPluginInterface &eve } mView->loadXmls(worldModel); + mView->resetDrawAction(); loadReadOnlyFlags(logicalModel); QLOG_DEBUG() << "Reloading 2D world done"; diff --git a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp index dc252008cc..7070dd8fa4 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp +++ b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp @@ -300,6 +300,11 @@ void TwoDModelWidget::initPalette() connect(imageTool, &QAction::triggered, this, [this](){ mUi->palette->unselect(); }); } +void TwoDModelWidget::resetDrawAction() +{ + mUi->palette->unselect(); +} + void TwoDModelWidget::initDetailsTab() { } diff --git a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts index ce9cde08aa..9004065bf1 100644 --- a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts +++ b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts @@ -301,7 +301,7 @@ twoDModel::engine::TwoDModelEngineFacade - + Realistic physics' must be turned on to enjoy skittles and balls @@ -728,7 +728,7 @@ twoDModel::view::TwoDModelWidget - + Warning Attention diff --git a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts index 3dce21146d..d3954a5c31 100644 --- a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts +++ b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts @@ -573,7 +573,7 @@ twoDModel::engine::TwoDModelEngineFacade - + Realistic physics' must be turned on to enjoy skittles and balls Реалистичная физика должна быть включена для взаимодействия с кеглями и мячами @@ -1071,7 +1071,7 @@ twoDModel::view::TwoDModelWidget - + Warning Предупреждение