-
Notifications
You must be signed in to change notification settings - Fork 212
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
No coordinates are shown for new part during its placing in 3D view #939
Comments
I can confirm this is still occurring on a freshly compiled version from
|
I think I have located the reason of the bug, which is not really a bug, but a missing feature. Your video is missing an important piece of information: You have no selected part in the 3D model while you place a new part. The issue becomes evident if you select a part in the existing 3d model and then use a drag&drop operation from the part lists. You will see that the part is still selected as you place the new one, and the status bar shows the coordinates of that selected element. leocad-939-1.webmNotice how the status bar updates to the coordinates of the new added part after the drop operation completes and it becomes the selected part of the 3d model. The cause of this resides on how LeoCad updates the status bar: The data is not being "pushed" into the bar, but there is a routine which is "pulling" data from the application, and the coordinates section seems to be using the position of the selected part in the current model... not the location of a piece what is not yet part of the model which is being hovered over the 3d view. I'll see if I can extract the part for updating the coordinates and then reuse it in the drag&drop/hovering events. I still need to find the place in code triggering this. |
I was not able to solve this task, and since I have timeboxed it I'll pause my work on it for a while. Here my findings just in case someone else wants to pick this issue up. SummaryThere is a central routine Using some oldschool
Points of interest (IMO)The location where the drag&drop operation starts, creating a Drag and drop events are managed in common/lc_viewwidget.cpp and common/lc_view.cpp, apparently using a view/controller strategy.
Notes:
Code responsible to detect currently selected/focused element, it does not contemplate pieces being dragged. Solving point 1The After a while I can say with some confidence that the correct location to do this is in lcView::OnMouseMove() @ common/lc_view.cpp#L2780. But we should avoid doing the call if no drag operation is in progress. One way would be to check that drag state like this if(mDragState == lcDragState::Piece)
{
gMainWindow->UpdateSelectedObjects(false)
} Another way would be by making an assumption: it looks like the variable if (mTrackTool == lcTrackTool::Insert)
ActiveModel->UpdateAllViews(); to if (mTrackTool == lcTrackTool::Insert)
{
ActiveModel->UpdateAllViews();
gMainWindow->UpdateSelectedObjects(true);
} Solving point 2 and 3In order to be able to show the position of the current piece being dragged, we need to know where that information is stored, I was not able to find this. Having the vital piece of information we could either have a special case in I may try picking this issue again in the future. I also have the impression that this bug may be somewhat related to #942 |
Describe the bug
No coordinates are shown for new part during placing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When new part are in adding state show its coordinates immediatly in status bar.
If part are dropped back to "Parts" list (without pasting into scene), in status bar show coordinates of previously active part in scene.
Screenshots
Here is a screencast video. Look on status bar when part is moved from "Parts" list to "3D View".
leocad-part-coordinates.webm
Version (please complete the following information):
Crash information:
None
Additional context
None
The text was updated successfully, but these errors were encountered: