Skip to content

Commit

Permalink
Don't change start position if item is not editable
Browse files Browse the repository at this point in the history
  • Loading branch information
IKhonakhbeeva committed Oct 22, 2023
1 parent b3d33cb commit 2baf069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions plugins/robots/common/twoDModel/src/engine/items/ballItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2baf069

Please sign in to comment.