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
9ee8d1a2
Commit
9ee8d1a2
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module editor loads the last edited footprint in GAL mode.
parent
6d1417ba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
11 deletions
+31
-11
loadcmp.cpp
pcbnew/loadcmp.cpp
+1
-9
modedit.cpp
pcbnew/modedit.cpp
+1
-2
module_editor_frame.h
pcbnew/module_editor_frame.h
+3
-0
moduleframe.cpp
pcbnew/moduleframe.cpp
+26
-0
No files found.
pcbnew/loadcmp.cpp
View file @
9ee8d1a2
...
...
@@ -49,7 +49,6 @@
#include <class_board.h>
#include <class_module.h>
#include <io_mgr.h>
#include <tool/tool_manager.h>
#include <pcbnew.h>
#include <module_editor_frame.h>
...
...
@@ -121,14 +120,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
Zoom_Automatique
(
false
);
if
(
IsGalCanvasActive
()
)
{
static_cast
<
PCB_DRAW_PANEL_GAL
*>
(
GetGalCanvas
()
)
->
DisplayBoard
(
GetBoard
()
);
m_Pcb
->
ComputeBoundingBox
(
false
);
EDA_RECT
boardBbox
=
m_Pcb
->
GetBoundingBox
();
GetGalCanvas
()
->
GetView
()
->
SetViewport
(
BOX2D
(
boardBbox
.
GetOrigin
(),
boardBbox
.
GetSize
()
)
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
MODEL_RELOAD
);
}
updateView
();
return
true
;
}
...
...
pcbnew/modedit.cpp
View file @
9ee8d1a2
...
...
@@ -935,8 +935,7 @@ void FOOTPRINT_EDIT_FRAME::UseGalCanvas( bool aEnable )
if
(
aEnable
)
{
SetBoard
(
m_Pcb
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
GAL_SWITCH
);
updateView
();
GetGalCanvas
()
->
StartDrawing
();
}
}
pcbnew/module_editor_frame.h
View file @
9ee8d1a2
...
...
@@ -439,6 +439,9 @@ protected:
*/
void
updateTitle
();
/// Reloads displayed items and sets view.
void
updateView
();
/// The libPath is not publicly visible, grab it from the FP_LIB_TABLE if we must.
const
wxString
getLibPath
();
...
...
pcbnew/moduleframe.cpp
View file @
9ee8d1a2
...
...
@@ -680,3 +680,29 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
SetTitle
(
title
);
}
void
FOOTPRINT_EDIT_FRAME
::
updateView
()
{
static_cast
<
PCB_DRAW_PANEL_GAL
*>
(
GetGalCanvas
()
)
->
DisplayBoard
(
GetBoard
()
);
m_Pcb
->
ComputeBoundingBox
(
false
);
EDA_RECT
boardBbox
=
m_Pcb
->
GetBoundingBox
();
BOX2D
bbox
;
if
(
boardBbox
.
GetSize
().
x
>
0
&&
boardBbox
.
GetSize
().
y
>
0
)
{
bbox
.
SetOrigin
(
VECTOR2D
(
boardBbox
.
GetOrigin
()
)
);
bbox
.
SetSize
(
VECTOR2D
(
boardBbox
.
GetSize
()
)
);
}
else
{
// Default empty view
bbox
.
SetOrigin
(
VECTOR2D
(
-
1000
,
-
1000
)
);
bbox
.
SetSize
(
VECTOR2D
(
2000
,
2000
)
);
}
GetGalCanvas
()
->
GetView
()
->
SetViewport
(
bbox
);
m_toolManager
->
ResetTools
(
TOOL_BASE
::
MODEL_RELOAD
);
}
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