The main idea was to have two types of connection points: some default connection points (as currently only the center is) and user defined connection points. There would be 9 default connection points: the center (the only one available now) and other 8 connection points that you get when you draw 8 imaginary lines that connect the center to the corners of the object's bounding box and the midpoints of the edges of the object's bounding box and intersect these imaginary lines with the object's edge.
just as an idea, I would suggest to handle connections more generic. Instead of using default and configurable fixed connection points it would be better to attach directly to the objects outer shape using generic connection points. In this case no predefined connection points need to be shown as the shape is shown in any case. When a handle gets near the shape the shape itself might get highlighted to indicate it will catch the handle when dropped.
When the handle gets dropped near the shape it should connect to the shapes outer sub element (e.g. the nearest line of an rectangle) at an offset from its center calculated from the point of dropping the handle using a calculated normal. The Object would store the connection by adding an additional connection object to its connection list. Each connection object would at least need:
- a reference to the attached handle, - a reference to the shapes sub element, to which the handle is attached - a relative offset from the shapes sub elements center point. - the normal vector to be optionally used for connecting attached line with an angle normal to the outer shape ( eg. for round objects) - sharp edges and the center of an sub element could be made prefered relative positions to snap to
This could allow: * to delete connections when getting disconnected. * no need to handling additional default points * scaling of objects without disturbing the arrangement of the attached handles * allow attachments without code to display additional points/crosses/circles to show the user where he can attach the handle * no need decide in advance on the placement of the default connection point * individual placement by dropping the handle where it should stay * grabbing and moving the handle to a different location along the outer shape
I don't know anything of the code base nor do I have any time to work on this in any capacity but envision the idea could lead to better diagram layout and improved usability.
Hans