According to http://www.uml-diagrams.org/component-diagrams.html component ports are aligned to the outline border of the related component eg. -----[]-----. With recent umbrello versions the ports are displayed outside of the component e.g _____[]____. This should be fixed. How to reproduce: 1. Start umbrello 2. Create a new component diagram 3. Add a component 4. Add a port to the component created at 3. What happens: The port displayed at the top outline of the component is not vertical aligned What is expected: The port at the top outline of the component should be aligned vertical
Created attachment 102618 [details] Place Pins/Ports onto parent border
Comment on attachment 102618 [details] Place Pins/Ports onto parent border > Place Pin/Ports onto parent border. Just to be sure: Your patch limits this behavior to ports only as indicated by the title ? https://de.wikipedia.org/wiki/Pin_(UML) mentions that pins need to be displayed still outside. I guess the class PinPortBase needs to have a protected member to be able to switch on this new behavior only in the derived PortWidget constructor.
(In reply to #2) The patch changes PinPortBase, so affects both Components and Activities. I wasn't aware that they need to be handled differently. I'll rework the patch.
Created attachment 102655 [details] Place ports onto parent border Pins stay attached to outside shape.
Comment on attachment 102655 [details] Place ports onto parent border Works as expected Below are some notes relating to code style: +#ifndef CHILDWIDGETPLACEMENT_H__ please remove the traling '__ +class ChildWidgetPlacement can you add some docs to the class and +#define CHILDWIDGETPLACEMENTPIN_H__ dito +#include <umlwidgets/childwidgetplacement.h> either #include "umlwidgets/childwidgetplacement.h" or #include "childwidgetplacement.h" +#include <umlwidgets/umlwidget.h> use "" instead of <> because the related headers are local
Created attachment 102666 [details] Place ports onto parent border
Fix review findings.
Git commit d2b7dc0a71e75e2f65f18c0d4f1452bf7544bea5 by Ralf Habacker, on behalf of Carsten Clever. Committed on 08/12/2016 at 22:25. Pushed by habacker into branch 'master'. Place ports onto parent border. M +3 -0 umbrello/CMakeLists.txt A +64 -0 umbrello/umlwidgets/childwidgetplacement.cpp [License: GPL (v2+)] A +62 -0 umbrello/umlwidgets/childwidgetplacement.h [License: GPL (v2+)] A +148 -0 umbrello/umlwidgets/childwidgetplacementpin.cpp [License: GPL (v2+)] A +47 -0 umbrello/umlwidgets/childwidgetplacementpin.h [License: GPL (v2+)] A +190 -0 umbrello/umlwidgets/childwidgetplacementport.cpp [License: GPL (v2+)] A +36 -0 umbrello/umlwidgets/childwidgetplacementport.h [License: GPL (v2+)] M +23 -115 umbrello/umlwidgets/pinportbase.cpp M +5 -18 umbrello/umlwidgets/pinportbase.h https://commits.kde.org/umbrello/d2b7dc0a71e75e2f65f18c0d4f1452bf7544bea5
Created attachment 102835 [details] Fix placement of Port when resizing parent. When Port is placed on Upper-Right or Lower-Left corner of parent, it is now moved correctly when the parent is resized.
Comment on attachment 102666 [details] Place ports onto parent border committed to git master
Comment on attachment 102835 [details] Fix placement of Port when resizing parent. I applied this patch to recent git master and tried to compile, which fails with the following errors: /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:49:22: error: assignment of read-only variable ‘newY’ newY = minY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:63:22: error: assignment of read-only variable ‘newY’ newY = maxY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:77:22: error: assignment of read-only variable ‘newX’ newX = minX(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:91:22: error: assignment of read-only variable ‘newX’ newX = maxX(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:100:22: error: assignment of read-only variable ‘newY’ newY = minY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:104:22: error: assignment of read-only variable ‘newX’ newX = minX(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:113:22: error: assignment of read-only variable ‘newY’ newY = minY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:117:22: error: assignment of read-only variable ‘newX’ newX = maxX(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:126:22: error: assignment of read-only variable ‘newY’ newY = maxY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:130:22: error: assignment of read-only variable ‘newX’ newX = maxX(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:139:22: error: assignment of read-only variable ‘newY’ newY = maxY(); ^ /home/xxx/src/umbrello-master/umbrello/umlwidgets/childwidgetplacementport.cpp:143:22: error: assignment of read-only variable ‘newX’ newX = minX(); ^
Created attachment 102879 [details] Fix placement of Port when resizing parent - fixed compile error When Port is placed on Upper-Right or Lower-Left corner of parent, it is now moved correctly when the parent is resized.
(In reply to #11) Indeed - I forgot to rebuild after refactoring. Patch updated.
Git commit b4126d84c6f38d07e0b787902ecdd8e2c725f79c by Ralf Habacker, on behalf of Carsten Clever. Committed on 19/12/2016 at 19:19. Pushed by habacker into branch 'master'. Fix placement of Port when resizing parent. When Port is placed on Upper-Right or Lower-Left corner of parent, it is now moved correctly when the parent is resized. M +96 -47 umbrello/umlwidgets/childwidgetplacementport.cpp M +5 -1 umbrello/umlwidgets/childwidgetplacementport.h https://commits.kde.org/umbrello/b4126d84c6f38d07e0b787902ecdd8e2c725f79c
These patches also introduced a previously non-existent problem: The created ports are not located at the cursor position when clicking on the component, but always in the upper left corner.
(In reply to Ralf Habacker from comment #15) > These patches also introduced a previously non-existent problem: The created > ports are not located at the cursor position when clicking on the component, > but always in the upper left corner. Cannot reproduce this problem with current git master. The new port is created near the mouse release location, i.e. usually inside the component. After dragging the port to a component edge, it stays in place and moves in sync with the component. This was fixed on addressing bug 403692.