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

#6215 – Introducing the snap to angle and standard bond length for monomers connected via bonds #6570

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

svvald
Copy link
Collaborator

@svvald svvald commented Feb 25, 2025

How the feature works? / How did you fix the issue?

(Screenshots, videos, or GIFs, if applicable)

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request

@svvald svvald changed the title 6215 introducing the snap to angle and standard bond length for monomers connected via bonds #6215 – Introducing the snap to angle and standard bond length for monomers connected via bonds Feb 25, 2025
snapPosition,
).length();

if (distanceToSnapPosition < 0.375) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move 0.375 to constant and use here and I remember the same somewhere in curved bonds

SelectRectangle.calculateAngleSnap(
cursorPositionInAngstroms,
connectedMonomer.position,
this.editor.mode.modeName === 'snake-layout-mode' ? 90 : 30,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use this.editor.mode instanceof SnakeMode?

Comment on lines +372 to +378
if (isAngleSnapped && isDistanceSnapped) {
snapPosition = distanceSnapPosition;
} else if (isAngleSnapped) {
snapPosition = angleSnapPosition;
} else if (isDistanceSnapped) {
snapPosition = distanceSnapPosition;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clear what happens in this method. Thank you

Comment on lines +112 to +113
this.topLayer.selectAll('*').remove();
this.defaultLayer.selectAll('*').remove();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how * selector works for d3, but potentially it could be a cause of performance degradation in some cases. Let's just keep it in mind for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better to organize elements somehow to delete only group element

@svvald svvald force-pushed the 6215-introducing-the-snap-to-angle-and-standard-bond-length-for-monomers-connected-via-bonds branch from c5dc1b6 to 885f752 Compare February 28, 2025 14:26
@svvald svvald force-pushed the 6215-introducing-the-snap-to-angle-and-standard-bond-length-for-monomers-connected-via-bonds branch from 885f752 to 250b9f1 Compare February 28, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introducing the snap-to-angle and standard bond length (for monomers connected via bonds)
2 participants