Issue with Navigation Cube dragging

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Jolbas
Posts: 335
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Issue with Navigation Cube dragging

Post by Jolbas »

When dragging the navigation cube the cube jumps to the middle of 3D view and then the position is limited to the lower left part of the view. Actually I would prefer that the cube wasn't draggable at all and leave that gesture to a future rotate view feature.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.28765 (Git)
Build type: Release
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * kugghjul.py
  * __pycache__
  * Assembly4 0.11.12
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Issue with Navigation Cube dragging

Post by wmayer »

When dragging the navigation cube the cube jumps to the middle of 3D view and then the position is limited to the lower left part of the view.
Is this behaviour new or was it like that all the time? Recently a change was made to avoid to drag the navi cube out of the 3d view:
Fix: git commit be2ddb37a6ff6d637b0b7699d
Bug report: https://github.com/FreeCAD/FreeCAD/issues/6306
I would prefer that the cube wasn't draggable at all and leave that gesture to a future rotate view feature.
Maybe an option can be added to lock it.
User avatar
Jolbas
Posts: 335
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Issue with Navigation Cube dragging

Post by Jolbas »

I don't have knowledge to build and try all versions but it works as expected in version 28575 and the problem is present in version 28751.
So you may be right in that it has to do with that commit.
User avatar
Jolbas
Posts: 335
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Issue with Navigation Cube dragging

Post by Jolbas »

wmayer wrote: Sat Apr 30, 2022 8:15 amFix: git commit be2ddb37a6ff6d637b0b7699d
It is as if this->m_View3DInventorViewer->width() returns half of the views width. Something to do with screen resolution maybe.

The NaviCubeImplementation::handleResize() function does not have this issue. That function uses
m_View3DInventorViewer->getSoRenderManager()->getSize() to get the size of the view instead. Maybe the code to place the cube in NaviCubeImplementation::handleResize() can be shared with NaviCubeImplementation::mouseMoved(short x, short y)
wmayer wrote: Sat Apr 30, 2022 8:15 am Maybe an option can be added to lock it.
That would be great. Maybe have "Moveable/Draggable" as a fifth option in the "Corner"-popup in Preferences->Display->Navigation. And replace "Corner" title with "Placement".
The four corner options could then lock the cube to this corner and maybe later have the feature to rotate view on drag
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Issue with Navigation Cube dragging

Post by wmayer »

It is as if this->m_View3DInventorViewer->width() returns half of the views width. Something to do with screen resolution maybe.
Do you have a high DPI monitor?
User avatar
Jolbas
Posts: 335
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Issue with Navigation Cube dragging

Post by Jolbas »

wmayer wrote: Sun May 01, 2022 4:30 pm Do you have a high DPI monitor?
Yes, It's a Mac laptop with 2880 × 1800 pixels but it pretends to have only 1440 x 900 pixels.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Issue with Navigation Cube dragging

Post by wmayer »

Jolbas wrote: Sun May 01, 2022 9:16 pm
wmayer wrote: Sun May 01, 2022 4:30 pm Do you have a high DPI monitor?
Yes, It's a Mac laptop with 2880 × 1800 pixels but it pretends to have only 1440 x 900 pixels.
OK, this could explain the behaviour. In many situations a value must be multiplied with the device pixel ratio and it's not always obvious when it must be done.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Issue with Navigation Cube dragging

Post by wmayer »

That indeed was the problem. It's fixed now with git commit 254a1c5645
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Issue with Navigation Cube dragging

Post by wmayer »

Added a feature request for the locking mechanism: issue #6818
User avatar
Jolbas
Posts: 335
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Issue with Navigation Cube dragging

Post by Jolbas »

Thanks
Post Reply