SUMMARY Nested classifiers/nested packages which are moved to inside their enclosing package become invisible STEPS TO REPRODUCE 1. In the tree view, right click on Logical View, select "Package..." and create a new_package 2. In the tree view, right click on new_package, select "Package..." and create a nested new_package. Rename it to "nested_pkg" for clarity. 3. Drag new_package to class diagram and resize it to be large enough to contain nested items. 4. Drag nested_pkg to inside the new_package display area in the class diagram. 5. Click on new_package in the diagram. OBSERVED RESULT The nested_pkg vanishes, i.e. it is obscured by its containing package. EXPECTED RESULT Objects nested in the diagram display area of their containing package shall be visible at all times. SOFTWARE/OS VERSIONS Umbrello git master of 2021-12-27
Git commit 8f410485cfcc75a4fe452708d8b1aa009ae35f50 by Oliver Kellogg. Committed on 29/12/2021 at 21:51. Pushed by okellogg into branch 'master'. Fix "Diagram objects moved to inside enclosing package become invisible" umbrello/umlwidgets/widget_utils.{h,cpp} - New function ensureNestedVisible prevents nested widget(s) located inside the area of a larger widget from disappearing. This is achieved by increasing the Z value on the contained widgets. umbrello/toolbarstate.cpp - In function mouseRelease add debug messages in the branches of the if-chain to ease tracing of events. - In function mouseReleaseEmpty, if m_currentWidget is non null then call Widget_Utils::ensureNestedVisible with arguments m_currentWidget and m_pUMLScene->widgetList(). umbrello/umlwidgets/toolbarstateonewidget.cpp - Split if-statement testing m_pMouseEvent->button() and currentWidget() into two separate if-statements. Return immediately if m_pMouseEvent->button() is not Qt::LeftButton. - Add local UMLWidget *currWgt as shorthand for currentWidget(). - Call Widget_Utils::ensureNestedVisible with arguments currWgt and m_pUMLScene->widgetList() before executing the second part of the split if-statement (see above). umbrello/umlwidgets/umlwidget.{h,cpp} - New function isLocatedIn(const UMLWidget *other) returns true if `this' is located in the bounding rectangle of `other'. umbrello/umlwidgets/umlwidget.cpp - In function mouseReleaseEvent : - In if-statement testing (!m_moved && !m_resized), if neither (!m_shiftPressed && (m_scene->selectedCount() > 1)) nor !isSelected() evaluates to true then call Widget_Utils::ensureNestedVisible(this, umlScene()->widgetList()). - In else-part of the if-statement, if m_moved is true then - local UMLWidgetList selectedWidgets acts as shorthand for umlScene()->selectedWidgets(); - in foreach-loop over selectedWidgets additionally call Widget_Utils::ensureNestedVisible with arguments `widget' and umlScene()->widgetList(). - In function setSelected add call to Widget_Utils::ensureNestedVisible(this, umlScene()->widgetList()). M +9 -1 umbrello/toolbarstate.cpp M +17 -8 umbrello/umlwidgets/toolbarstateonewidget.cpp M +50 -2 umbrello/umlwidgets/umlwidget.cpp M +2 -0 umbrello/umlwidgets/umlwidget.h M +21 -0 umbrello/umlwidgets/widget_utils.cpp M +3 -1 umbrello/umlwidgets/widget_utils.h https://invent.kde.org/sdk/umbrello/commit/8f410485cfcc75a4fe452708d8b1aa009ae35f50
Git commit a038b342b30a43faae177cd140bddccbd1daf674 by Oliver Kellogg. Committed on 30/12/2021 at 13:07. Pushed by okellogg into branch 'master'. Completion of fix for "Diagram objects moved to inside enclosing package become invisible" umbrello/umlscene.cpp - In function createAutoAssociations code handling "object is capable of containing nested objects" use new function UMLWidget::isLocatedIn(). Reason: WidgetBase function rect() always returns x() and y() with value 0, which is not right for this context. M +2 -2 umbrello/umlscene.cpp https://invent.kde.org/sdk/umbrello/commit/a038b342b30a43faae177cd140bddccbd1daf674
*** Bug 209757 has been marked as a duplicate of this bug. ***