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

Clean up code in AddLayerPanel component and drag and drop #746

Merged
merged 20 commits into from
Aug 8, 2024
Merged

Conversation

vincentfretin
Copy link
Collaborator

@vincentfretin vincentfretin commented Aug 8, 2024

This is mainly code cleanup and creating pure functions (not using variables from outside the function) to better understand this code.
I fixed some issues and implemented drag and drop.
This closes #576

  • Don't recreate AddLayerPanel each time we want to add an element, and make sure getSelectedMixinCards is not recalculated unnecessarily.
  • Don't create preview entity each time the panel open.
  • Don't set y to 0.2 for preview on non segment (for example bicycle on waterfront :p) and properly use worldToLocal when creating the entity so the preview and created entity are at the same position.
  • Placing a second element moved the existing custom-group entity instead of moving the second entity inside the existing custom-group entity.
  • The preview entity wrongly used a previous position instead of scene origin when no entity was selected.
  • Instead of scene origin, place element at the intersection of ground and current camera position.
  • Select created entity.
  • Allow to drag and drop card to create an element at the drop position

@vincentfretin vincentfretin self-assigned this Aug 8, 2024
@vincentfretin vincentfretin requested a review from kfarr August 8, 2024 11:01
@vincentfretin vincentfretin changed the title Clean up code in AddLayerPanel component Clean up code in AddLayerPanel component and drag and drop Aug 8, 2024
@vincentfretin
Copy link
Collaborator Author

@kfarr Drag an drop implemented, creating the element in 3dstreet-container.
You can add your cursor and it's good to merge.

@kfarr kfarr merged commit 7b7ed1a into main Aug 8, 2024
1 check passed
@kfarr kfarr deleted the add-panel branch August 8, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

add "drag and drop" to add new entity panel
2 participants