From 827dad319732f8a2c9bb1d77c4e2ffe67aab1208 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sun, 6 Dec 2015 18:22:13 -0500 Subject: [PATCH] GAL bug fixes cherry picked from product branch. --- common/gal/opengl/opengl_gal.cpp | 2 +- common/tool/tool_interactive.cpp | 4 +++- pcbnew/router/router_tool.cpp | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index a9fbcdc808..73c71fb207 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -358,7 +358,7 @@ void OPENGL_GAL::DrawArc( const VECTOR2D& aCenterPoint, double aRadius, double a SWAP( aStartAngle, >, aEndAngle ); Save(); - currentManager->Translate( aCenterPoint.x, aCenterPoint.y, layerDepth ); + currentManager->Translate( aCenterPoint.x, aCenterPoint.y, 0.0 ); if( isStrokeEnabled ) { diff --git a/common/tool/tool_interactive.cpp b/common/tool/tool_interactive.cpp index 86a2c71b50..5f05de8e4f 100644 --- a/common/tool/tool_interactive.cpp +++ b/common/tool/tool_interactive.cpp @@ -66,6 +66,8 @@ void TOOL_INTERACTIVE::goInternal( TOOL_STATE_FUNC& aState, const TOOL_EVENT_LIS void TOOL_INTERACTIVE::SetContextMenu( CONTEXT_MENU* aMenu, CONTEXT_MENU_TRIGGER aTrigger ) { - aMenu->SetTool( this ); + if( aMenu ) + aMenu->SetTool( this ); + m_toolMgr->ScheduleContextMenu( this, aMenu, aTrigger ); } diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 387e03cfbd..1ab66f60e0 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -722,6 +722,9 @@ int ROUTER_TOOL::mainLoop( PNS_ROUTER_MODE aMode ) m_savedSettings = m_router->Settings(); m_savedSizes = m_router->Sizes(); + // Disable the context menu before it is destroyed + SetContextMenu( NULL, CMENU_OFF ); + return 0; } @@ -745,8 +748,6 @@ void ROUTER_TOOL::performDragging() { ctls->ForceCursorPosition( false ); - VECTOR2I p0 = ctls->GetCursorPosition(); - if( evt->IsCancel() || evt->IsActivate() ) break; else if( evt->IsMotion() )