35 parentState(parentState),
36 position(QPointF(StateDefaultSize.toSize().width() * 0.1 + rand() % StateDefaultSize.toSize().width() * 0.7, StateDefaultSize.toSize().height() * 0.3 + rand() % StateDefaultSize.toSize().height()) * 0.7),
37 boundingSquareSize(defaultBoundingSquareSize)
46 if (
name.length() > 0)
115 QRectF rect(QPointF(0, 0), parent->getSize());
118 auto rm = parent->margin.width();
120 auto right = rect.right();
121 auto left = rect.left();
122 auto lm = parent->margin.left();
124 newPos.setX(qMin(right - bw - rm,
127 newPos.setY(qMin(rect.bottom() -
getBounds().height() - parent->margin.height(),
129 rect.top() + parent->margin.top())));
136 if (std::isnan(newPosition.x()) || std::isnan(newPosition.y()))
143 if ((
position - newPosition).manhattanLength() < 2)
174 if (std::isnan(newStateCenter.x()) || std::isnan(newStateCenter.y()))
252 if (getParent() && getParent()->getActiveSubstate() == shared_from_this())