You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and checked the recent builds/commits
What would your feature do ?
The moment a user drags an item/link connector close to the border of the canvas the viewport should start moving in the same direction.
Screencast.from.2025-02-10.20-04-47.mp4
Proposed workflow
Drag a node close to the edges of the viewport
Update the viewport and node position based on the mouse location using the draw tick and delta time
Expose threshold and speed multiplier inside the UI settings
Implementation
Update using DeltaT:
Instead of purely updating the position based on the tick/draw event we use delta T to make sure the movement stays consistent otherwise the speed would vary depending on the fps
Poor mans normalized Vector2:
Instead of using an actual normalized Vector2 we'll clamp the calculated vector to a range between [-1,1].
There's no need for a real unit vector. This way we save a sqrt calculation to increase the performance.
Updates when dragging a Positionable or Link connector:
Due to the function adding to the draw loop we'll only run it when dragging around an object but it could be used for general panning as well by setting it active when pressing the middle mouse button (panning mode)
TODO: Add movement multiplier and threshold to UI settings
PS: I tried to adapt as many of your code conventions as possible but I might have overdone it with the code comments/descriptions. Please let me know what you think.
Cheers,
Leo
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
What would your feature do ?
The moment a user drags an item/link connector close to the border of the canvas the viewport should start moving in the same direction.
Screencast.from.2025-02-10.20-04-47.mp4
Proposed workflow
Implementation
Update using DeltaT:
Instead of purely updating the position based on the tick/draw event we use delta T to make sure the movement stays consistent otherwise the speed would vary depending on the fps
Poor mans normalized Vector2:
Instead of using an actual normalized Vector2 we'll clamp the calculated vector to a range between [-1,1].
There's no need for a real unit vector. This way we save a sqrt calculation to increase the performance.
Updates when dragging a Positionable or Link connector:
Due to the function adding to the draw loop we'll only run it when dragging around an object but it could be used for general panning as well by setting it active when pressing the middle mouse button (panning mode)
TODO: Add movement multiplier and threshold to UI settings
PS: I tried to adapt as many of your code conventions as possible but I might have overdone it with the code comments/descriptions. Please let me know what you think.
Cheers,
Leo
The text was updated successfully, but these errors were encountered: