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
5fea60d2
Commit
5fea60d2
authored
Jan 30, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed undo/redo while routing with the PNS error.
parent
510fee13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
router_tool.cpp
pcbnew/router/router_tool.cpp
+17
-8
No files found.
pcbnew/router/router_tool.cpp
View file @
5fea60d2
...
@@ -290,6 +290,7 @@ void ROUTER_TOOL::updateEndItem( TOOL_EVENT& aEvent )
...
@@ -290,6 +290,7 @@ void ROUTER_TOOL::updateEndItem( TOOL_EVENT& aEvent )
void
ROUTER_TOOL
::
startRouting
()
void
ROUTER_TOOL
::
startRouting
()
{
{
bool
saveUndoBuffer
=
true
;
VIEW_CONTROLS
*
ctls
=
getViewControls
();
VIEW_CONTROLS
*
ctls
=
getViewControls
();
int
width
=
getDefaultWidth
(
m_startItem
?
m_startItem
->
GetNet
()
:
-
1
);
int
width
=
getDefaultWidth
(
m_startItem
?
m_startItem
->
GetNet
()
:
-
1
);
...
@@ -317,16 +318,16 @@ void ROUTER_TOOL::startRouting()
...
@@ -317,16 +318,16 @@ void ROUTER_TOOL::startRouting()
{
{
if
(
evt
->
IsCancel
()
)
if
(
evt
->
IsCancel
()
)
break
;
break
;
else
if
(
evt
->
Action
()
==
TA_UNDO_REDO
)
{
saveUndoBuffer
=
false
;
break
;
}
else
if
(
evt
->
IsMotion
()
)
else
if
(
evt
->
IsMotion
()
)
{
{
updateEndItem
(
*
evt
);
updateEndItem
(
*
evt
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
}
}
else
if
(
evt
->
Action
()
==
TA_UNDO_REDO
)
{
std
::
cout
<<
"syncing the world while routing, I am going to craaaaaaaaaaaash!"
<<
std
::
endl
;
m_router
->
SyncWorld
();
}
else
if
(
evt
->
IsClick
(
BUT_LEFT
)
)
else
if
(
evt
->
IsClick
(
BUT_LEFT
)
)
{
{
updateEndItem
(
*
evt
);
updateEndItem
(
*
evt
);
...
@@ -376,9 +377,17 @@ void ROUTER_TOOL::startRouting()
...
@@ -376,9 +377,17 @@ void ROUTER_TOOL::startRouting()
m_router
->
StopRouting
();
m_router
->
StopRouting
();
// Save the recent changes in the undo buffer
if
(
saveUndoBuffer
)
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SaveCopyInUndoList
(
m_router
->
GetLastChanges
(),
UR_UNSPECIFIED
);
{
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnModify
();
// Save the recent changes in the undo buffer
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
SaveCopyInUndoList
(
m_router
->
GetLastChanges
(),
UR_UNSPECIFIED
);
getEditFrame
<
PCB_EDIT_FRAME
>
()
->
OnModify
();
}
else
{
// It was interrupted by TA_UNDO_REDO event, so we have to sync the world now
m_router
->
SyncWorld
();
}
ctls
->
SetAutoPan
(
false
);
ctls
->
SetAutoPan
(
false
);
ctls
->
ForceCursorPosition
(
false
);
ctls
->
ForceCursorPosition
(
false
);
...
...
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