Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
2aef11a5
Commit
2aef11a5
authored
Feb 10, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made rotate & flip tool actions generic.
Drawing tool reacts to rotate & flip events while placing a text.
parent
4b277784
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
common_actions.cpp
pcbnew/tools/common_actions.cpp
+2
-2
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+14
-0
No files found.
pcbnew/tools/common_actions.cpp
View file @
2aef11a5
...
@@ -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)"
);
...
...
pcbnew/tools/drawing_tool.cpp
View file @
2aef11a5
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment