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

When dropping an object in "build mode", both vertices should pop inside the black box #113

Closed
samreid opened this issue May 29, 2016 · 7 comments

Comments

@samreid
Copy link
Member

samreid commented May 29, 2016

When dropping an object in "build mode", its vertices should pop inside the black box

@samreid samreid self-assigned this May 29, 2016
samreid added a commit that referenced this issue May 31, 2016
@samreid
Copy link
Member Author

samreid commented May 31, 2016

The above implementation just bumps one of the vertices inside the black box, and translates everything with it. If a single wire is dropped outside the black box, both vertices may go to the same point. Despite these limitations, this implementation seems very useful and may be good enough. On hold until next published version, then @arouinfar can review and comment.

@samreid
Copy link
Member Author

samreid commented Jun 6, 2016

Please see #126 for testing.

@samreid samreid assigned arouinfar and unassigned samreid Jun 6, 2016
@arouinfar
Copy link
Contributor

If a single wire is dropped outside the black box, both vertices may go to the same point.

I've noticed that both vertices always go to the same point, so long as both vertices were located outside of the black box. To me this doesn't cue that items must be placed within the black box.
wiredot

Could the wires do this instead (or maintain their width when translating)? That way both vertices are still viewable and the wire looks like it's been moved inside the black box.
image

It looks like the right side of the component snaps to the closest edge of the black box. If items are dropped to the left of the black box, they still appear to be outside of the black box after snapping. I think it's best if objects snap so that they are contained within the black box.
blackboxsnapping

At the end of this .gif you may notice that the battery and resistor look like they may have potentially overlapped, so the resistor rotated. However, the they did not actually connect, so there may be some edge-case funniness with #125.

@arouinfar arouinfar assigned samreid and unassigned arouinfar Jun 8, 2016
This was referenced Jun 14, 2016
@samreid samreid changed the title When dropping an object in "build mode", its vertices should pop inside the black box When dropping an object in "build mode", both vertices should pop inside the black box Jun 14, 2016
@samreid
Copy link
Member Author

samreid commented Jun 14, 2016

In the above commit, I iterate over all vertices in a fixed subgraph and move them all inside the black box. It works well, but now we must tackle variable-length wires.

@samreid
Copy link
Member Author

samreid commented Jun 14, 2016

In the above solution, I applied a 2-pass approach that seems to work well for translating things as well as shrinking wires that are longer than the black box, it will need to be tested.

@samreid
Copy link
Member Author

samreid commented Jun 14, 2016

Please see #134 for testing.

@arouinfar
Copy link
Contributor

Looks good @samreid! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants