Commit 7c482f68 authored by CHARRAS's avatar CHARRAS

Added Jonas Diemer's patch (3D display: enhanced movings from mouse and tools)

parent 56ef4d3b
...@@ -283,14 +283,25 @@ void Pcb3D_GLCanvas::OnMouseEvent( wxMouseEvent& event ) ...@@ -283,14 +283,25 @@ void Pcb3D_GLCanvas::OnMouseEvent( wxMouseEvent& event )
if( event.Dragging() ) if( event.Dragging() )
{ {
/* drag in progress, simulate trackball */ if( event.LeftIsDown() )
trackball( spin_quat, {
(2.0 * g_Parm_3D_Visu.m_Beginx - size.x) / size.x, /* drag in progress, simulate trackball */
(size.y - 2.0 * g_Parm_3D_Visu.m_Beginy) / size.y, trackball( spin_quat,
( 2.0 * event.GetX() - size.x) / size.x, (2.0 * g_Parm_3D_Visu.m_Beginx - size.x) / size.x,
( size.y - 2.0 * event.GetY() ) / size.y ); (size.y - 2.0 * g_Parm_3D_Visu.m_Beginy) / size.y,
( 2.0 * event.GetX() - size.x) / size.x,
add_quats( spin_quat, g_Parm_3D_Visu.m_Quat, g_Parm_3D_Visu.m_Quat ); ( size.y - 2.0 * event.GetY() ) / size.y );
add_quats( spin_quat, g_Parm_3D_Visu.m_Quat, g_Parm_3D_Visu.m_Quat );
}
else if( event.MiddleIsDown() )
{
/* middle button drag -> pan */
/* Current zoom and an additional factor are taken into account for the amount of panning. */
const float PAN_FACTOR = 8.0 * g_Parm_3D_Visu.m_Zoom;
g_Draw3d_dx -= PAN_FACTOR * ( g_Parm_3D_Visu.m_Beginx - event.GetX() ) / size.x;
g_Draw3d_dy -= PAN_FACTOR * (event.GetY() - g_Parm_3D_Visu.m_Beginy) / size.y;
}
/* orientation has changed, redraw mesh */ /* orientation has changed, redraw mesh */
DisplayStatus(); DisplayStatus();
......
This diff is collapsed.
...@@ -5,6 +5,12 @@ Started 2007-June-11 ...@@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-mars-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
3d display:
Added Jonas Diemer's patch (enhanced movings from mouse and tools)
2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment