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
3c656691
Commit
3c656691
authored
Feb 28, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed POINT_EDITOR crash on GAL change / board reload.
parent
f87f12e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
15 deletions
+21
-15
point_editor.cpp
pcbnew/tools/point_editor.cpp
+20
-14
point_editor.h
pcbnew/tools/point_editor.h
+1
-1
No files found.
pcbnew/tools/point_editor.cpp
View file @
3c656691
...
...
@@ -96,6 +96,12 @@ POINT_EDITOR::POINT_EDITOR() :
}
void
POINT_EDITOR
::
Reset
(
RESET_REASON
aReason
)
{
m_editPoints
.
reset
();
}
bool
POINT_EDITOR
::
Init
()
{
// Find the selection tool, so they can cooperate
...
...
@@ -130,6 +136,14 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
// Main loop: keep receiving events
while
(
OPT_TOOL_EVENT
evt
=
Wait
()
)
{
if
(
!
m_editPoints
||
evt
->
IsCancel
()
||
evt
->
Matches
(
m_selectionTool
->
ClearedEvent
)
||
evt
->
Matches
(
m_selectionTool
->
DeselectedEvent
)
||
evt
->
Matches
(
m_selectionTool
->
SelectedEvent
)
)
{
break
;
}
if
(
evt
->
IsMotion
()
)
{
EDIT_POINT
*
point
=
m_editPoints
->
FindPoint
(
evt
->
Position
()
);
...
...
@@ -168,23 +182,18 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
updatePoints
();
}
else
if
(
evt
->
IsCancel
()
||
evt
->
Matches
(
m_selectionTool
->
ClearedEvent
)
||
evt
->
Matches
(
m_selectionTool
->
DeselectedEvent
)
||
evt
->
Matches
(
m_selectionTool
->
SelectedEvent
)
)
{
break
;
}
else
{
m_toolMgr
->
PassEvent
();
}
}
m_toolMgr
->
GetView
()
->
Remove
(
m_editPoints
.
get
()
);
m_editPoints
.
reset
();
item
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
if
(
m_editPoints
)
{
item
->
ViewUpdate
(
KIGFX
::
VIEW_ITEM
::
GEOMETRY
);
m_toolMgr
->
GetView
()
->
Remove
(
m_editPoints
.
get
()
);
m_editPoints
.
reset
();
}
}
controls
->
ShowCursor
(
false
);
...
...
@@ -265,9 +274,6 @@ void POINT_EDITOR::updateItem() const
void
POINT_EDITOR
::
updatePoints
()
const
{
if
(
!
m_editPoints
)
return
;
EDA_ITEM
*
item
=
m_editPoints
->
GetParent
();
switch
(
item
->
Type
()
)
...
...
pcbnew/tools/point_editor.h
View file @
3c656691
...
...
@@ -44,7 +44,7 @@ public:
POINT_EDITOR
();
/// @copydoc TOOL_INTERACTIVE::Reset()
void
Reset
(
RESET_REASON
aReason
)
{}
;
void
Reset
(
RESET_REASON
aReason
);
/// @copydoc TOOL_INTERACTIVE::Init()
bool
Init
();
...
...
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