Made rotate & flip tool actions generic.
Drawing tool reacts to rotate & flip events while placing a text.
This commit is contained in:
parent
4b27778451
commit
2aef11a5fc
|
@ -41,11 +41,11 @@ TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit",
|
||||||
AS_GLOBAL, 'M',
|
AS_GLOBAL, 'M',
|
||||||
"Move", "Moves the selected item(s)" );
|
"Move", "Moves the selected item(s)" );
|
||||||
|
|
||||||
TOOL_ACTION COMMON_ACTIONS::rotate( "pcbnew.InteractiveEdit.rotate",
|
TOOL_ACTION COMMON_ACTIONS::rotate( "pcbnew.rotate",
|
||||||
AS_CONTEXT, 'R',
|
AS_CONTEXT, 'R',
|
||||||
"Rotate", "Rotates selected item(s)" );
|
"Rotate", "Rotates selected item(s)" );
|
||||||
|
|
||||||
TOOL_ACTION COMMON_ACTIONS::flip( "pcbnew.InteractiveEdit.flip",
|
TOOL_ACTION COMMON_ACTIONS::flip( "pcbnew.flip",
|
||||||
AS_CONTEXT, 'F',
|
AS_CONTEXT, 'F',
|
||||||
"Flip", "Flips selected item(s)" );
|
"Flip", "Flips selected item(s)" );
|
||||||
|
|
||||||
|
|
|
@ -374,6 +374,20 @@ int DRAWING_TOOL::DrawText( TOOL_EVENT& aEvent )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if( evt->Category() == TC_COMMAND )
|
||||||
|
{
|
||||||
|
if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
|
||||||
|
{
|
||||||
|
newText->Rotate( newText->GetPosition(), getEditFrame<PCB_EDIT_FRAME>()->GetRotationAngle() );
|
||||||
|
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
|
||||||
|
}
|
||||||
|
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
|
||||||
|
{
|
||||||
|
newText->Flip( newText->GetPosition() );
|
||||||
|
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if( evt->IsClick( BUT_LEFT ) )
|
else if( evt->IsClick( BUT_LEFT ) )
|
||||||
{
|
{
|
||||||
newText->ClearFlags();
|
newText->ClearFlags();
|
||||||
|
|
Loading…
Reference in New Issue