mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 18:14:13 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user