Fix repeat(no-further-actions) snapshot
parent
5407eedad7
commit
cd6a973fe7
|
@ -343,7 +343,7 @@ void SkeletonDocument::scaleNodeByAddRadius(QUuid nodeId, float amount)
|
||||||
}
|
}
|
||||||
if (isPartReadonly(it->second.partId))
|
if (isPartReadonly(it->second.partId))
|
||||||
return;
|
return;
|
||||||
it->second.radius += amount;
|
it->second.setRadius(it->second.radius + amount);
|
||||||
emit nodeRadiusChanged(nodeId);
|
emit nodeRadiusChanged(nodeId);
|
||||||
emit skeletonChanged();
|
emit skeletonChanged();
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ void SkeletonDocument::setNodeRadius(QUuid nodeId, float radius)
|
||||||
}
|
}
|
||||||
if (isPartReadonly(it->second.partId))
|
if (isPartReadonly(it->second.partId))
|
||||||
return;
|
return;
|
||||||
it->second.radius = radius;
|
it->second.setRadius(radius);
|
||||||
emit nodeRadiusChanged(nodeId);
|
emit nodeRadiusChanged(nodeId);
|
||||||
emit skeletonChanged();
|
emit skeletonChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,14 @@ public:
|
||||||
{
|
{
|
||||||
id = withId.isNull() ? QUuid::createUuid() : withId;
|
id = withId.isNull() ? QUuid::createUuid() : withId;
|
||||||
}
|
}
|
||||||
|
void setRadius(float toRadius)
|
||||||
|
{
|
||||||
|
if (toRadius < 0.01)
|
||||||
|
toRadius = 0.01;
|
||||||
|
else if (toRadius > 1)
|
||||||
|
toRadius = 1;
|
||||||
|
radius = toRadius;
|
||||||
|
}
|
||||||
QUuid id;
|
QUuid id;
|
||||||
QUuid partId;
|
QUuid partId;
|
||||||
QString name;
|
QString name;
|
||||||
|
|
|
@ -307,6 +307,7 @@ bool SkeletonGraphicsWidget::mouseMove(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_lastScenePos = mouseScenePos;
|
m_lastScenePos = mouseScenePos;
|
||||||
|
m_moveHappened = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,6 +382,7 @@ bool SkeletonGraphicsWidget::mouseRelease(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
if (m_moveStarted) {
|
if (m_moveStarted) {
|
||||||
m_moveStarted = false;
|
m_moveStarted = false;
|
||||||
|
if (m_moveHappened)
|
||||||
emit groupOperationAdded();
|
emit groupOperationAdded();
|
||||||
}
|
}
|
||||||
if (m_rangeSelectionStarted) {
|
if (m_rangeSelectionStarted) {
|
||||||
|
@ -477,11 +479,14 @@ bool SkeletonGraphicsWidget::mousePress(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
if (!m_rangeSelectionSet.empty()) {
|
if (!m_rangeSelectionSet.empty()) {
|
||||||
if (!QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier)) {
|
if (!QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier)) {
|
||||||
|
if (!m_moveStarted) {
|
||||||
m_moveStarted = true;
|
m_moveStarted = true;
|
||||||
m_lastScenePos = mouseEventScenePos(event);
|
m_lastScenePos = mouseEventScenePos(event);
|
||||||
|
m_moveHappened = false;
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (processed) {
|
if (processed) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,6 +331,7 @@ private:
|
||||||
bool m_rangeSelectionStarted;
|
bool m_rangeSelectionStarted;
|
||||||
std::set<QGraphicsItem *> m_rangeSelectionSet;
|
std::set<QGraphicsItem *> m_rangeSelectionSet;
|
||||||
bool m_mouseEventFromSelf;
|
bool m_mouseEventFromSelf;
|
||||||
|
bool m_moveHappened;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SkeletonGraphicsContainerWidget : public QWidget
|
class SkeletonGraphicsContainerWidget : public QWidget
|
||||||
|
|
Loading…
Reference in New Issue