Don't try and run drawing tools in ModEdit with no module selected.
Fixes: lp:1836673 * https://bugs.launchpad.net/kicad/+bug/1836673
This commit is contained in:
parent
0b08e4dcd2
commit
02eb1d2c62
|
@ -1130,7 +1130,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN
|
|||
* of an Arc Geometry Manager
|
||||
*/
|
||||
static void updateArcFromConstructionMgr( const KIGFX::PREVIEW::ARC_GEOM_MANAGER& aMgr,
|
||||
DRAWSEGMENT& aArc )
|
||||
DRAWSEGMENT& aArc )
|
||||
{
|
||||
auto vec = aMgr.GetOrigin();
|
||||
|
||||
|
@ -1357,6 +1357,9 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE_CONTAINER*& aZo
|
|||
|
||||
int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_editModules && !m_frame->GetModel() )
|
||||
return 0;
|
||||
|
||||
ZONE_MODE zoneMode = aEvent.Parameter<ZONE_MODE>();
|
||||
MODE drawMode = MODE::ZONE;
|
||||
|
||||
|
|
|
@ -285,6 +285,9 @@ int MODULE_EDITOR_TOOLS::DefaultPadProperties( const TOOL_EVENT& aEvent )
|
|||
|
||||
int MODULE_EDITOR_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( !m_frame->GetBoard()->GetFirstModule() )
|
||||
return 0;
|
||||
|
||||
struct PAD_PLACER : public INTERACTIVE_PLACER_BASE
|
||||
{
|
||||
std::unique_ptr<BOARD_ITEM> CreateItem() override
|
||||
|
|
|
@ -61,7 +61,8 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
|
|||
|
||||
auto makeNewItem = [&] ( VECTOR2I aPosition )
|
||||
{
|
||||
newItem = aPlacer->CreateItem();
|
||||
if( frame()->GetModel() )
|
||||
newItem = aPlacer->CreateItem();
|
||||
|
||||
if( newItem )
|
||||
{
|
||||
|
|
|
@ -447,6 +447,9 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else
|
||||
{
|
||||
if( m_editModules && !getEditFrame<PCB_BASE_EDIT_FRAME>()->GetModel() )
|
||||
return 0;
|
||||
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool<PCBNEW_PICKER_TOOL>();
|
||||
|
||||
|
@ -481,6 +484,9 @@ int PCBNEW_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent )
|
|||
|
||||
int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
if( m_editModules && !m_frame->GetBoard()->GetFirstModule() )
|
||||
return 0;
|
||||
|
||||
std::string tool = aEvent.GetCommandStr().get();
|
||||
PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool<PCBNEW_PICKER_TOOL>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue