Commit 2aef11a5 authored by Maciej Suminski's avatar Maciej Suminski

Made rotate & flip tool actions generic.

Drawing tool reacts to rotate & flip events while placing a text.
parent 4b277784
...@@ -41,11 +41,11 @@ TOOL_ACTION COMMON_ACTIONS::editActivate( "pcbnew.InteractiveEdit", ...@@ -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 ) ...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment