Bug 403692 - Associations connected to the component port do not move when moving the component
Summary: Associations connected to the component port do not move when moving the comp...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.27.1 (KDE Applications 18.12.1)
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-28 14:31 UTC by Ralf Habacker
Modified: 2021-01-08 21:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.27.2 (KDE Applications 18.12.2)


Attachments
test case (19.10 KB, application/x-uml)
2019-01-28 14:31 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2019-01-28 14:31:42 UTC
Created attachment 117700 [details]
test case

STEPS TO REPRODUCE
1. start umbrello
2. open appended test case
3. move component "CreditCardChange"

OBSERVED RESULT
The association end point connected to the port is only updated after move has been finished


EXPECTED RESULT
The association end point connected to the port should follow the component movement


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE_Leap_42.3
KDE Frameworks Version: 5.54
Qt Version: 5.11
Comment 1 Ralf Habacker 2019-01-28 14:41:28 UTC
Git commit a7d6f7dc24f3b52c3deaf55bf3b745652efa2994 by Ralf Habacker.
Committed on 28/01/2019 at 14:38.
Pushed by habacker into branch 'Applications/18.12'.

Fix 'Associations connected to the component port do not move when moving the component'

The ComponentWidget class requires an implementation of
adjustUnselectedAssocs() to update the associations attached to the ports.
To do this, UMLWidget::adjustUnselectedAssocs() must be converted to a
virtual method.
FIXED-IN:2.27.2 (KDE Applications 18.12.2)

M  +22   -0    umbrello/umlwidgets/componentwidget.cpp
M  +1    -0    umbrello/umlwidgets/componentwidget.h
M  +1    -1    umbrello/umlwidgets/umlwidget.h

https://commits.kde.org/umbrello/a7d6f7dc24f3b52c3deaf55bf3b745652efa2994
Comment 2 Ralf Habacker 2019-01-28 14:41:29 UTC
Git commit c995f32e05f648bfe3800f3c8da0fbfafc41cca8 by Ralf Habacker.
Committed on 28/01/2019 at 14:41.
Pushed by habacker into branch 'Applications/18.12'.

In UMLWidget::mouseMoveEvent() remove duplicated call to adjustUnselectedAssocs()

The current widget is selected and will be handled in the following loop.

M  +0    -1    umbrello/umlwidgets/umlwidget.cpp

https://commits.kde.org/umbrello/c995f32e05f648bfe3800f3c8da0fbfafc41cca8
Comment 3 Oliver Kellogg 2021-01-08 21:00:19 UTC
Git commit 2d1468b2940032e8eae83fcc7b7a122e184fd28c by Oliver Kellogg.
Committed on 08/01/2021 at 21:00.
Pushed by okellogg into branch 'master'.

Fix misplacement of startpoint on associationline originating at port:

umbrello/umlwidgets/umlwidget.{h,cpp}
- Add virtual functions getX / getY returning qreal and getPos returning
  QPointF.  Default implementation calls QGraphicsObjectWrapper
  functions x() / y() / pos().

umbrello/umlwidgets/pinportbase.{h,cpp}
- Reimplement virtual functions getX / getY and getPos.
  They call the respective function of UMLWidget but add the respective
  component of parentItem() (i.e. x(), y(), pos() resp.)
  Reason: PinPortBase coordinates are relative to their ComponentWidget.

umbrello/toolbarstateassociation.cpp
- In function setSecondWidget, after creating the AssociationWidget
  check whether widgetA is a PortWidget. If it is then
  - store widgetA->getPos() to local variable lineStart;
  - set the startpoint of the association line to lineStart.

umbrello/umlwidgets/associationwidget.cpp
- Use new UMLWidget functions getX / getY / getPos in all code that is
  related to association line calculation and update:
  Function calculateEndingPoints, doUpdates, updateRegionLineCount.

M  +6    -1    umbrello/toolbarstateassociation.cpp
M  +11   -11   umbrello/umlwidgets/associationwidget.cpp
M  +16   -1    umbrello/umlwidgets/pinportbase.cpp
M  +5    -1    umbrello/umlwidgets/pinportbase.h
M  +34   -1    umbrello/umlwidgets/umlwidget.cpp
M  +3    -0    umbrello/umlwidgets/umlwidget.h

https://invent.kde.org/sdk/umbrello/commit/2d1468b2940032e8eae83fcc7b7a122e184fd28c