mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
EDA_3D_CANVAS: fix crash when used in dialogs and clicking in the 3D shape
It was due to the fact a message (using ExpressMail) was sent to the board and schematic editor, but it is possible only if the manager of this canvas is a EDA_3D_VIEWER_FRAME, because only this kind of frame has ExpressMail stuff Fixes https://gitlab.com/kicad/code/kicad/-/issues/21728
This commit is contained in:
parent
79a3b7ac5f
commit
aa4de22ef4
@ -1087,14 +1087,16 @@ void EDA_3D_CANVAS::OnLeftDown( wxMouseEvent& event )
|
||||
|
||||
if( footprint )
|
||||
{
|
||||
std::string command =
|
||||
fmt::format( "$SELECT: 0,F{}",
|
||||
EscapeString( footprint->GetReference(), CTX_IPC ).ToStdString() );
|
||||
|
||||
EDA_3D_VIEWER_FRAME* frame = static_cast<EDA_3D_VIEWER_FRAME*>( GetParent() );
|
||||
// We send a message (by ExpressMail) to the board and schematic editor, but only
|
||||
// if the manager of this canvas is a EDA_3D_VIEWER_FRAME, because only this
|
||||
// kind of frame has ExpressMail stuff
|
||||
EDA_3D_VIEWER_FRAME* frame = dynamic_cast<EDA_3D_VIEWER_FRAME*>( GetParent() );
|
||||
|
||||
if( frame )
|
||||
{
|
||||
std::string command = fmt::format( "$SELECT: 0,F{}",
|
||||
EscapeString( footprint->GetReference(), CTX_IPC ).ToStdString() );
|
||||
|
||||
frame->Kiway().ExpressMail( FRAME_PCB_EDITOR, MAIL_SELECTION, command, frame );
|
||||
frame->Kiway().ExpressMail( FRAME_SCH, MAIL_SELECTION, command, frame );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user