3dviewer zoom not limited with Use touchpad to pan

Bug #1625754 reported by xzcvczx
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
xzcvczx

Bug Description

If you use touchpad to pan and then use pinch-to-zoom on osx the zoom-out is not limited unlike with normal mousewheel zoom. This causes the model to disappear briefly and then if you continue to zoom out the board will reappear rotated 180 degrees around the up/down (Y) axis (not sure if thats what 3dviewer calls y but i do).

The zoom level required for this to happen is well beyond what you can even get near to zooming out to with the mousewheel zoom.

Application: kicad
Version: (2016-09-16 revision e8b2444)-master, release build
Libraries: wxWidgets 3.0.2
           libcurl/7.43.0 SecureTransport zlib/1.2.5
Platform: Mac OS X (Darwin 15.6.0 x86_64), 64 bit, Little endian, wxMac
- Build Info -
wxWidgets: 3.0.2 (UTF-8,STL containers,compatible with 2.8)
Boost: 1.61.0
Curl: 7.43.0
KiCad - Compiler: Clang 7.3.0 with C++ ABI 1002
        Settings: USE_WX_GRAPHICS_CONTEXT=ON
                  USE_WX_OVERLAY=ON
                  KICAD_SCRIPTING=ON
                  KICAD_SCRIPTING_MODULES=ON
                  KICAD_SCRIPTING_WXPYTHON=ON
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_SCH_IO_MANAGER=OFF
                  KICAD_USE_OCE=ON

Tags: 3d-viewer osx
xzcvczx (xzcvczx)
tags: added: 3d-viewer osx
Revision history for this message
xzcvczx (xzcvczx) wrote :
Revision history for this message
xzcvczx (xzcvczx) wrote :
xzcvczx (xzcvczx)
Changed in kicad:
assignee: nobody → Mario Luzeiro (mrluzeiro)
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

Just checked, the zoom function is the same, the parameter value may be different and causing the issue.

I never tested that feature before (no Mac access)

The function:
bool CCAMERA::ZoomIn( float aFactor )
must be add a check / validation of input aFactor as there is any at moment.

Could someone with MAC debug that function?

I think in the addition, this lines can be added:

        if( m_zoom >= MAX_ZOOM )
            m_zoom = MAX_ZOOM;

after line "m_zoom /= aFactor;"

aFactor should be checked for very small numbers too.

I still dont have setuped /learned how to contribute to this new GIT platform.

Revision history for this message
xzcvczx (xzcvczx) wrote :

i am just building to debug this now..... Could/would it not be better to just have a single Zoom function since it has the factor option anyways that could define out/in?

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

It may be ok to create a ZoomTo function for that (or other) proposes.
As explained, I dont have access to a MAC to try it.

That functionality was copied from the old 3Dviewer, so I try to adapt as it looks right to me, but I never tested. so there is this new bug that you found. But I believe if proper limits are implemented it will fix it.

Revision history for this message
xzcvczx (xzcvczx) wrote :

I had forgotten about this bug, However i have made a patch but as its your code feel free to chip in before its merged

It merges zoomIn and zoomOut into a single function for each t1 and normal

It fixes another bug where you can get stuck at "MAX_ZOOM" due to your if's around the entire function

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 19512b46a38777639a7f6109be9d80e1a0fddc18
https://git.launchpad.net/kicad/patch/?id=19512b46a38777639a7f6109be9d80e1a0fddc18

Changed in kicad:
status: New → Fix Committed
assignee: Mario Luzeiro (mrluzeiro) → Simon Wells (xzcvczx)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.