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
3e46f223
Commit
3e46f223
authored
Apr 30, 2015
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected "Zoom Auto" in GAL with empty board.
parent
6379d806
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
pcbnew_control.cpp
pcbnew/tools/pcbnew_control.cpp
+4
-5
No files found.
pcbnew/tools/pcbnew_control.cpp
View file @
3e46f223
...
@@ -100,18 +100,17 @@ int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
...
@@ -100,18 +100,17 @@ int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
BOARD
*
board
=
getModel
<
BOARD
>
();
BOARD
*
board
=
getModel
<
BOARD
>
();
board
->
ComputeBoundingBox
();
board
->
ComputeBoundingBox
();
BOX2I
boardBBox
=
board
->
ViewBBox
();
BOX2I
boardBBox
=
board
->
ViewBBox
();
VECTOR2I
screenSize
=
gal
->
GetScreenPixelSize
();
if
(
boardBBox
.
GetSize
().
x
==
0
||
boardBBox
.
GetSize
().
y
==
0
)
if
(
boardBBox
.
GetSize
().
x
==
0
||
boardBBox
.
GetSize
().
y
==
0
)
{
{
// Empty view
// Empty view
view
->
Set
Scale
(
100000.0
);
view
->
Set
Center
(
view
->
ToWorld
(
VECTOR2D
(
screenSize
.
x
/
2
,
screenSize
.
y
/
2
)
)
);
view
->
Set
Center
(
VECTOR2D
(
0
,
0
)
);
view
->
Set
Scale
(
17.0
);
}
}
else
else
{
{
// Autozoom to board
// Autozoom to board
VECTOR2I
screenSize
=
gal
->
GetScreenPixelSize
();
double
iuPerX
=
screenSize
.
x
?
boardBBox
.
GetWidth
()
/
screenSize
.
x
:
1.0
;
double
iuPerX
=
screenSize
.
x
?
boardBBox
.
GetWidth
()
/
screenSize
.
x
:
1.0
;
double
iuPerY
=
screenSize
.
y
?
boardBBox
.
GetHeight
()
/
screenSize
.
y
:
1.0
;
double
iuPerY
=
screenSize
.
y
?
boardBBox
.
GetHeight
()
/
screenSize
.
y
:
1.0
;
...
@@ -119,8 +118,8 @@ int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
...
@@ -119,8 +118,8 @@ int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
double
zoomFactor
=
gal
->
GetWorldScale
()
/
gal
->
GetZoomFactor
();
double
zoomFactor
=
gal
->
GetWorldScale
()
/
gal
->
GetZoomFactor
();
double
zoom
=
1.0
/
(
zoomFactor
*
bestZoom
);
double
zoom
=
1.0
/
(
zoomFactor
*
bestZoom
);
view
->
SetScale
(
zoom
);
view
->
SetCenter
(
boardBBox
.
Centre
()
);
view
->
SetCenter
(
boardBBox
.
Centre
()
);
view
->
SetScale
(
zoom
);
}
}
return
0
;
return
0
;
...
...
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