Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect start of line when placed inside an element #616

Merged
merged 1 commit into from Jan 21, 2021

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Jan 20, 2021

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

The line end is connected to an element when placed on a diagram. The line head is not.

Issue Number: N/A

What is the new behavior?

Also connect line head after a line is connected.

Other information

To reproduce:

  1. create 2 classes
  2. Draw an Association from the center of class 1 to the center of class 2
  3. The association should connect on both sides.

So both ends are connected once the line is drawn.
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 20, 2021

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.08%.

Quality metrics Before After Change
Complexity 2.92 ⭐ 2.79 ⭐ -0.13 👍
Method Length 44.07 ⭐ 43.44 ⭐ -0.63 👍
Working memory 7.10 🙂 7.14 🙂 0.04 👎
Quality 79.88% 79.96% 0.08% 👍
Other metrics Before After Change
Lines 168 172 4
Changed files Quality Before Quality After Quality Change
gaphor/diagram/diagramtools/grayout.py 85.67% ⭐ 86.84% ⭐ 1.17% 👍
gaphor/diagram/diagramtools/placement.py 78.23% ⭐ 77.82% ⭐ -0.41% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gaphor/diagram/diagramtools/placement.py on_drag_end 1 ⭐ 57 ⭐ 10 😞 74.38% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@amolenaar amolenaar added this to the 2.2 milestone Jan 20, 2021
@danyeaw danyeaw merged commit bcc73f3 into master Jan 21, 2021
@danyeaw danyeaw deleted the connect-opposite-handle-on=placement branch January 21, 2021 02:31
@danyeaw
Copy link
Member

danyeaw commented Jan 21, 2021

This looks great!

@danyeaw danyeaw added the feature A new feature label Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants