Updating the user grid size on change in GAL.
This commit is contained in:
parent
3e46f2233a
commit
787415c2aa
|
@ -34,8 +34,10 @@
|
||||||
#include <pcbnew_id.h>
|
#include <pcbnew_id.h>
|
||||||
#include <dialog_set_grid_base.h>
|
#include <dialog_set_grid_base.h>
|
||||||
#include <invoke_pcb_dialog.h>
|
#include <invoke_pcb_dialog.h>
|
||||||
|
|
||||||
#include <gal/graphics_abstraction_layer.h>
|
#include <gal/graphics_abstraction_layer.h>
|
||||||
#include <class_draw_panel_gal.h>
|
#include <class_draw_panel_gal.h>
|
||||||
|
#include <tool/tool_manager.h>
|
||||||
|
|
||||||
|
|
||||||
class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE
|
class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE
|
||||||
|
@ -227,12 +229,12 @@ bool PCB_BASE_FRAME::InvokeDialogGrid()
|
||||||
if( screen->GetGridId() == ID_POPUP_GRID_USER )
|
if( screen->GetGridId() == ID_POPUP_GRID_USER )
|
||||||
screen->SetGrid( ID_POPUP_GRID_USER );
|
screen->SetGrid( ID_POPUP_GRID_USER );
|
||||||
|
|
||||||
if( IsGalCanvasActive() )
|
// Notify GAL
|
||||||
{
|
TOOL_MANAGER* mgr = GetToolManager();
|
||||||
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( screen->GetGrid().m_Size.x,
|
|
||||||
screen->GetGrid().m_Size.y ) );
|
if( mgr && IsGalCanvasActive() )
|
||||||
GetGalCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
mgr->RunAction( "common.Control.gridPreset", true,
|
||||||
}
|
ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000 );
|
||||||
|
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,15 @@ int PCBNEW_CONTROL::ZoomPreset( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_frame->SetPresetZoom( idx );
|
m_frame->SetPresetZoom( idx );
|
||||||
|
|
||||||
if( idx == 0 )
|
if( idx == 0 ) // Zoom Auto
|
||||||
|
{
|
||||||
return ZoomFitScreen( aEvent );
|
return ZoomFitScreen( aEvent );
|
||||||
|
}
|
||||||
else if( idx < 0 || idx >= zoomList.size() )
|
else if( idx < 0 || idx >= zoomList.size() )
|
||||||
|
{
|
||||||
|
assert( false );
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
double selectedZoom = zoomList[idx];
|
double selectedZoom = zoomList[idx];
|
||||||
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
|
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
|
||||||
|
|
Loading…
Reference in New Issue