Changes to use cursor position as parameter and snap to grid settings.
* Changed managed cursor callback definition to include the current cursor drawing position. * Modified all managed cursor callbacks to match new definition. * Added snap to grid option to base drawing frame object. * Changed add no connect managed cursor callback to use new position parameter instead of the stored one. * Lots of coding policy fixes.
This commit is contained in:
@@ -78,6 +78,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( wxWindow* father, int idtype,
|
||||
m_LastGridSizeId = 0;
|
||||
m_DrawGrid = true; // hide/Show grid. default = show
|
||||
m_GridColor = DARKGRAY; // Grid color
|
||||
m_snapToGrid = true;
|
||||
|
||||
// Internal units per inch: = 1000 for schema, = 10000 for PCB
|
||||
m_InternalUnits = EESCHEMA_INTERNAL_UNIT;
|
||||
@@ -450,6 +451,17 @@ void EDA_DRAW_FRAME::OnGrid( int grid_type )
|
||||
}
|
||||
|
||||
|
||||
wxPoint EDA_DRAW_FRAME::GetGridPosition( const wxPoint& aPosition )
|
||||
{
|
||||
wxPoint pos = aPosition;
|
||||
|
||||
if( m_CurrentScreen != NULL && m_snapToGrid )
|
||||
pos = m_CurrentScreen->GetNearestGridPosition( aPosition );
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
int EDA_DRAW_FRAME::ReturnBlockCommand( int key )
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user