35 parentState(parentState),
36 position(QPointF(StateDefaultSize.toSize().width() * 0.1 +
37 rand() % StateDefaultSize.toSize().width() * 0.7,
38 StateDefaultSize.toSize().height() * 0.3 +
39 rand() % StateDefaultSize.toSize().height()) *
41 boundingSquareSize(defaultBoundingSquareSize)
50 if (
name.length() > 0)
122 QRectF rect(QPointF(0, 0), parent->getSize());
125 auto rm = parent->margin.width();
127 auto right = rect.right();
128 auto left = rect.left();
129 auto lm = parent->margin.left();
131 newPos.setX(qMin(right - bw - rm, qMax(newPos.x(), left + lm)));
132 newPos.setY(qMin(rect.bottom() -
getBounds().height() - parent->margin.height(),
133 qMax(newPos.y(), rect.top() + parent->margin.top())));
141 if (std::isnan(newPosition.x()) || std::isnan(newPosition.y()))
144 <<
" contains NaN. wont set it";
149 if ((
position - newPosition).manhattanLength() < 2)
181 if (std::isnan(newStateCenter.x()) || std::isnan(newStateCenter.y()))
184 <<
" contains NaN. wont setting it";
191 QPointF newPosition =
262 if (getParent() && getParent()->getActiveSubstate() == shared_from_this())