Fix transform origin not applied on load or delayed activation

setTransformOriginPoint() was only applied inside
parentElementRotationChanged(), so loading an already-rotated element,
or enabling keep_visual_rotation while rotation_point_center was
already true, left the origin at (0, 0) until the next parent rotation.

Apply the origin directly in both setters so it's always in sync.

Added .ts files (de and en) to the commit
This commit is contained in:
Levi Jetzer
2026-08-08 20:06:32 +02:00
parent 615e40dee2
commit 3424ba50bd
3 changed files with 5220 additions and 13801 deletions
@@ -1516,6 +1516,7 @@ void DynamicElementTextItem::setKeepVisualRotation(bool set)
emit keepVisualRotationChanged(set);
if (set) {
m_visual_rotation_ref = this->rotation() + m_parent_element->rotation();
setTransformOriginPoint(m_rotation_point_center ? boundingRect().center() : QPointF(0,0));
connect(m_parent_element, &Element::rotationChanged, this, &DynamicElementTextItem::parentElementRotationChanged);
connect(this, &DynamicElementTextItem::rotationChanged, this, &DynamicElementTextItem::thisRotationChanged);
}
@@ -1533,6 +1534,8 @@ void DynamicElementTextItem::setRotationPointCenter(bool center)
{
if (m_rotation_point_center == center) return;
m_rotation_point_center = center;
if (m_keep_visual_rotation)
setTransformOriginPoint(center ? boundingRect().center() : QPointF(0,0));
emit rotationPointCenterChanged(center);
}