Address known issue of commit d22ed2f5,
> 2) On dragging a port on the diagram, the PortWidget should be made to snap to the nearest edge of the nearest ComponentWidget, i.e. the port should "stick" to a component on moving. umbrello/widgets/portwidget.{h,cpp} - New function attachToOwningComponent() aligns the PortWidget's position such that it is attached at one of the sides of its component's widget. - Reimplement function UMLWidget::moveWidgetBy() in order to constrain movement such that the port is always attached to its component. (Not flawless yet - to be improved.) - Change constant `FixedSize' to QSizeF(15, 15). Reason: Use same value for width and height to achieve uniform aspect regardless of the edge at which the port is attached to the component. umbrello/umlscene.{h,cpp} - At function widgetOnDiagram(Uml::ID::Type), change return type from bool to UMLWidget*. Return pointer to the widget corresponding to `id' if it is on the diagram, NULL if not. - In function setupNewWidget(), if `w' is of type wt_Port then delegate its setting of X/Y position to function PortWidget::attachToOwningComponent(). - In function dragEnterEvent() case DiagramType::Component, if `ot' is of type ot_Port then require that the owning component be present on the diagram in order to accept the drag event. CCBUG:115269
parent
d12efb31
Please register or sign in to comment