From c0cd7814ae8303528f9b83297bcb079343826bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Str=C3=B8m=C3=B8y?= Date: Thu, 26 Jun 2025 10:45:19 +0200 Subject: [PATCH] SCXMLEditor: TransitionItem::textWidth() returns the largest tag width Since the cond tag visually wraps beneath the event tag, the overall text width should be determined by the widest of the two. The new textWidth() implementation returns the maximum width of m_eventTagItem and m_condTagItem, ensuring the transition label is --- src/plugins/scxmleditor/plugin_interface/transitionitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp index d0ca869e718..19ba096fdc3 100644 --- a/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/transitionitem.cpp @@ -1319,7 +1319,7 @@ void TransitionItem::updateZValue() qreal TransitionItem::textWidth() const { - return m_eventTagItem->boundingRect().width() + m_condTagItem->boundingRect().width(); + return qMax(m_eventTagItem->boundingRect().width(), m_condTagItem->boundingRect().width()); } QRectF TransitionItem::wholeBoundingRect() const -- 2.43.0