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
05de84d5
Commit
05de84d5
authored
Feb 17, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Undo/redo support.
parent
6e52e193
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
drawing_tool.cpp
pcbnew/tools/drawing_tool.cpp
+26
-0
No files found.
pcbnew/tools/drawing_tool.cpp
View file @
05de84d5
...
@@ -197,6 +197,9 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
...
@@ -197,6 +197,9 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
m_view
->
Add
(
arc
);
m_view
->
Add
(
arc
);
m_board
->
Add
(
arc
);
m_board
->
Add
(
arc
);
arc
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
arc
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
arc
,
UR_NEW
);
}
}
else
else
--
step
;
// one another chance to draw a proper arc
--
step
;
// one another chance to draw a proper arc
...
@@ -309,6 +312,10 @@ int DRAWING_TOOL::DrawText( TOOL_EVENT& aEvent )
...
@@ -309,6 +312,10 @@ int DRAWING_TOOL::DrawText( TOOL_EVENT& aEvent )
m_view
->
Add
(
text
);
m_view
->
Add
(
text
);
// m_board->Add( text ); // it is already added by CreateTextePcb()
// m_board->Add( text ); // it is already added by CreateTextePcb()
text
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
text
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
text
,
UR_NEW
);
break
;
break
;
}
}
...
@@ -431,6 +438,9 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
...
@@ -431,6 +438,9 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
m_view
->
Add
(
dimension
);
m_view
->
Add
(
dimension
);
m_board
->
Add
(
dimension
);
m_board
->
Add
(
dimension
);
dimension
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
dimension
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
dimension
,
UR_NEW
);
}
}
}
}
break
;
break
;
...
@@ -507,6 +517,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
...
@@ -507,6 +517,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetAutoPan
(
true
);
Activate
();
Activate
();
...
@@ -542,6 +553,10 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
...
@@ -542,6 +553,10 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
m_view
->
Add
(
target
);
m_view
->
Add
(
target
);
m_board
->
Add
(
target
);
m_board
->
Add
(
target
);
target
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
target
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
target
,
UR_NEW
);
break
;
break
;
}
}
...
@@ -584,6 +599,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
...
@@ -584,6 +599,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
preview
.
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetSnapping
(
true
);
m_controls
->
SetAutoPan
(
true
);
Activate
();
Activate
();
...
@@ -617,6 +633,10 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
...
@@ -617,6 +633,10 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
m_view
)
);
module
->
RunOnChildren
(
std
::
bind1st
(
std
::
mem_fun
(
&
KIGFX
::
VIEW
::
Add
),
m_view
)
);
m_view
->
Add
(
module
);
m_view
->
Add
(
module
);
module
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
module
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
module
,
UR_NEW
);
break
;
break
;
}
}
...
@@ -748,6 +768,9 @@ int DRAWING_TOOL::drawSegment( int aShape, bool aContinous )
...
@@ -748,6 +768,9 @@ int DRAWING_TOOL::drawSegment( int aShape, bool aContinous )
preview
.
Remove
(
graphic
);
preview
.
Remove
(
graphic
);
++
addedSegments
;
++
addedSegments
;
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
graphic
,
UR_NEW
);
if
(
aContinous
)
if
(
aContinous
)
{
{
graphic
=
new
DRAWSEGMENT
(
*
graphic
);
graphic
=
new
DRAWSEGMENT
(
*
graphic
);
...
@@ -902,6 +925,9 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
...
@@ -902,6 +925,9 @@ int DRAWING_TOOL::drawZone( bool aKeepout )
m_frame
->
Fill_Zone
(
zone
);
m_frame
->
Fill_Zone
(
zone
);
zone
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
zone
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_frame
->
OnModify
();
m_frame
->
SaveCopyInUndoList
(
zone
,
UR_NEW
);
}
}
else
else
{
{
...
...
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