-
Notifications
You must be signed in to change notification settings - Fork 8
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
snap for multiple connections enabled #158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also please fix the issue with not snapping while creating node (either context menu or double click)?
@l3enQ yes, it is now enabled |
resources/Core/Scene.qml
Outdated
function snappedPosition (position) { | ||
return Qt.vector2d(Math.ceil(position.x / 20) * 20, Math.ceil(position.y / 20) * 20); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we update this function so it snap to nearest grid not the next one?!
i.e., using round and not ceil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also please check if we have the grid size some where like NLStyle or not!
resources/View/NodeView.qml
Outdated
node.guiConfig.position.x = Math.ceil(node.guiConfig.position.x / 20) * 20; | ||
} | ||
if(NLStyle.snapEnabled) | ||
node.guiConfig.position = Qt.vector2d(Math.ceil(node.guiConfig.position.x / 20) * 20, Math.ceil(node.guiConfig.position.y / 20) * 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use the same function in scene?
@@ -121,6 +121,10 @@ Item { | |||
if (obj?.objectType === NLSpec.ObjectType.Node) { | |||
obj.guiConfig.position.x += deltaX; | |||
obj.guiConfig.position.y += deltaY; | |||
|
|||
if(NLStyle.snapEnabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use another style, so we just snap the top left position of this view not nodes! but let's keep it as you did
@l3enQ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
Description
snap for multiple connections enabled
Fixes #155
Type of change
Checklist: