[WIP] Add a new variant of Bezier connection type #250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description of the Change
The current connection system is rather opinionated in terms of how the lines are oriented towards connectors, which makes getting a different look relatively difficult.
This change introduces a
OrientedConnection, which is heavily based onConnectionbut allows 360° free orientation of the start and end segments of the line. (The idea being similar to whatStepConnectiondoes withConnectorPosition, but more flexible)It can be used as-is, or we can discuss how to improve it or how to move some of the logic into Nodify's pre-existing base classes.
See: #249
🐛 Possible Drawbacks
This implementation entirely overrides the
Orientationproperties.It does take into account the
Directionproperty, but as theGetOffsetmethod, the locations may end up weird. (I honestly don't know how the logic here should be adapted, so I'll gladly take feedback on this)Currently, angles are expressed in an absolute way, similarly to how
ConnectorPositionis absolute. Another way to handle things would be as a rotation from the "default" 0°/90°/180°/270° orientation of connectors, or something similar. I went with the absolute angles implementation because it is the most straightforward one, but this is somethign really easy to adapt if one wants another logic.