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

Fix issue161 and 174. Use the same logic for selction and dragging, b… #672

Merged
merged 1 commit into from Aug 9, 2020

Conversation

phkahler
Copy link
Member

@phkahler phkahler commented Aug 7, 2020

This would be used instead of PR #658 because it fixes both issues while preserving the ability to drag underlying sketch points.

@phkahler
Copy link
Member Author

phkahler commented Aug 7, 2020

This does not work as well as current master for dragging lines in the underlying sketch. We could probably expand the idea to cover those (line with an immovable point could be skipped maybe?). Might need some refactoring too. Just want to know if this heading in the right direction and how far to go with it.

@phkahler
Copy link
Member Author

phkahler commented Aug 8, 2020

The latest version of this splits the draggability decision out into a funtion EntityBase::CanBeDragged(). Points, Lines, Arcs, and Beziers can all be dragged in an underlying sketch if they are not fully constrained.

This particular issue with drag being greedy is resolved by dragging whichever point hover/select would have picked. In this case neither of those points is considered "undraggable" so whichever one is hovered/highlighted will be the one selected for dragging.

@whitequark
Copy link
Contributor

This should probably live in Entity, not EntityBase, since it is an UI concern.

…ut ignore entites that are inherently undraggable.

This allows the selection to reach through entities to their corresponding ones on the underlying sketch which can be dragged if they are not fully constrained. This is decided in a new function Entity::CanBeDragged().
@phkahler
Copy link
Member Author

phkahler commented Aug 8, 2020

Moved it. Also added circles to the list because they weren't resizing in the base sketch when dragged.

@whitequark
Copy link
Contributor

@phkahler I just tested this PR and this is an excellent solution to several longstanding issues. Thank you!

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