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
e7aa9630
Commit
e7aa9630
authored
Jun 06, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed layers switching in GAL.
parent
f5de166a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
pcbnew_control.cpp
pcbnew/tools/pcbnew_control.cpp
+25
-4
No files found.
pcbnew/tools/pcbnew_control.cpp
View file @
e7aa9630
...
...
@@ -301,8 +301,19 @@ int PCBNEW_CONTROL::LayerNext( TOOL_EVENT& aEvent )
{
PCB_EDIT_FRAME
*
editFrame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
LAYER_NUM
layer
=
editFrame
->
GetActiveLayer
();
layer
=
(
layer
+
1
)
%
(
LAST_COPPER_LAYER
+
1
);
assert
(
IsCopperLayer
(
layer
)
);
if
(
(
layer
<
FIRST_COPPER_LAYER
)
||
(
layer
>=
LAST_COPPER_LAYER
)
)
{
setTransitions
();
return
0
;
}
if
(
getModel
<
BOARD
>
()
->
GetCopperLayerCount
()
<
2
)
// Single layer
layer
=
LAYER_N_BACK
;
else
if
(
layer
>=
getModel
<
BOARD
>
()
->
GetCopperLayerCount
()
-
2
)
layer
=
LAYER_N_FRONT
;
else
++
layer
;
editFrame
->
SwitchLayer
(
NULL
,
layer
);
editFrame
->
GetGalCanvas
()
->
SetFocus
();
...
...
@@ -317,8 +328,18 @@ int PCBNEW_CONTROL::LayerPrev( TOOL_EVENT& aEvent )
PCB_EDIT_FRAME
*
editFrame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
LAYER_NUM
layer
=
editFrame
->
GetActiveLayer
();
if
(
--
layer
<
0
)
layer
=
LAST_COPPER_LAYER
;
if
(
(
layer
<=
FIRST_COPPER_LAYER
)
||
(
layer
>
LAST_COPPER_LAYER
)
)
{
setTransitions
();
return
0
;
}
if
(
getModel
<
BOARD
>
()
->
GetCopperLayerCount
()
<
2
)
// Single layer
layer
=
LAYER_N_BACK
;
else
if
(
layer
==
LAYER_N_FRONT
)
layer
=
std
::
max
(
LAYER_N_BACK
,
FIRST_COPPER_LAYER
+
getModel
<
BOARD
>
()
->
GetCopperLayerCount
()
-
2
);
else
--
layer
;
assert
(
IsCopperLayer
(
layer
)
);
editFrame
->
SwitchLayer
(
NULL
,
layer
);
...
...
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