Summary: | Ports on components are not aligned at component border | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Ralf Habacker <ralf.habacker> |
Component: | general | Assignee: | Umbrello Development Group <umbrello-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | clushkou, okellogg, ralf.habacker |
Priority: | NOR | ||
Version: | 2.20.80 (KDE Applications 16.11.80) | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | All | ||
Latest Commit: | 2d1468b2940032e8eae83fcc7b7a122e184fd28c | Version Fixed In: | 2.33.80 (KDE releases 22.03.80) |
Sentry Crash Report: | |||
Bug Depends on: | 371990 | ||
Bug Blocks: | |||
Attachments: |
Place Pins/Ports onto parent border
Place ports onto parent border Place ports onto parent border Fix placement of Port when resizing parent. Fix placement of Port when resizing parent - fixed compile error |
Description
Ralf Habacker
2016-12-04 13:11:43 UTC
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. |