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
1f50b2c7
Commit
1f50b2c7
authored
Jun 17, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Fix an other compatibility issue in kicad nanometers.
parent
0028c054
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
30 deletions
+6
-30
class_zone.cpp
pcbnew/class_zone.cpp
+0
-21
class_zone.h
pcbnew/class_zone.h
+3
-6
class_zone_settings.h
pcbnew/class_zone_settings.h
+3
-3
No files found.
pcbnew/class_zone.cpp
View file @
1f50b2c7
...
@@ -489,9 +489,6 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition )
...
@@ -489,9 +489,6 @@ bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition )
// we must have a default distance between the test point
// we must have a default distance between the test point
// and a corner or a zone edge:
// and a corner or a zone edge:
#define MIN_DIST_IN_MILS 10
#define MIN_DIST_IN_MILS 10
// if we know the scaling factor, a dist in pixel can be used:
#define HIT_TEST_USE_PIXELS 1 // Set to 0 to used only a fixed default distance
#define MIN_DIST_IN_PIXELS 10
bool
ZONE_CONTAINER
::
HitTestForCorner
(
const
wxPoint
&
refPos
)
bool
ZONE_CONTAINER
::
HitTestForCorner
(
const
wxPoint
&
refPos
)
{
{
...
@@ -500,15 +497,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
...
@@ -500,15 +497,6 @@ bool ZONE_CONTAINER::HitTestForCorner( const wxPoint& refPos )
// distance (in internal units) to detect a corner in a zone outline.
// distance (in internal units) to detect a corner in a zone outline.
int
min_dist
=
MIN_DIST_IN_MILS
*
IU_PER_MILS
;
int
min_dist
=
MIN_DIST_IN_MILS
*
IU_PER_MILS
;
#if HIT_TEST_USE_PIXELS
// If possible, use a fixed number of pixels.
if
(
GetBoard
()
&&
GetBoard
()
->
GetParent
()
)
{
double
scale
=
((
PCB_BASE_FRAME
*
)
GetBoard
()
->
GetParent
())
->
GetScreen
()
->
GetScalingFactor
();
min_dist
=
KiROUND
(
MIN_DIST_IN_PIXELS
/
scale
);
}
#endif
wxPoint
delta
;
wxPoint
delta
;
unsigned
lim
=
m_Poly
->
corner
.
size
();
unsigned
lim
=
m_Poly
->
corner
.
size
();
...
@@ -540,15 +528,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
...
@@ -540,15 +528,6 @@ bool ZONE_CONTAINER::HitTestForEdge( const wxPoint& refPos )
// distance (in internal units) to detect a zone outline
// distance (in internal units) to detect a zone outline
int
min_dist
=
MIN_DIST_IN_MILS
*
IU_PER_MILS
;
int
min_dist
=
MIN_DIST_IN_MILS
*
IU_PER_MILS
;
#if HIT_TEST_USE_PIXELS
// If possible, use a fixed number of pixels.
if
(
GetBoard
()
&&
GetBoard
()
->
GetParent
()
)
{
double
scale
=
((
PCB_BASE_FRAME
*
)
GetBoard
()
->
GetParent
())
->
GetScreen
()
->
GetScalingFactor
();
min_dist
=
KiROUND
(
MIN_DIST_IN_PIXELS
/
scale
);
}
#endif
unsigned
first_corner_pos
=
0
;
unsigned
first_corner_pos
=
0
;
for
(
unsigned
item_pos
=
0
;
item_pos
<
lim
;
item_pos
++
)
for
(
unsigned
item_pos
=
0
;
item_pos
<
lim
;
item_pos
++
)
...
...
pcbnew/class_zone.h
View file @
1f50b2c7
...
@@ -511,12 +511,9 @@ public:
...
@@ -511,12 +511,9 @@ public:
void
SetCornerRadius
(
unsigned
int
aRadius
)
void
SetCornerRadius
(
unsigned
int
aRadius
)
{
{
if
(
aRadius
>
MAX_ZONE_CORNER_RADIUS
)
cornerRadius
=
aRadius
;
cornerRadius
=
MAX_ZONE_CORNER_RADIUS
;
if
(
cornerRadius
>
(
unsigned
int
)
Mils2iu
(
MAX_ZONE_CORNER_RADIUS_MILS
)
)
else
if
(
aRadius
<
0
)
cornerRadius
=
Mils2iu
(
MAX_ZONE_CORNER_RADIUS_MILS
);
cornerRadius
=
0
;
else
cornerRadius
=
aRadius
;
};
};
unsigned
int
GetCornerRadius
()
const
{
return
cornerRadius
;
};
unsigned
int
GetCornerRadius
()
const
{
return
cornerRadius
;
};
...
...
pcbnew/class_zone_settings.h
View file @
1f50b2c7
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
class
ZONE_CONTAINER
;
class
ZONE_CONTAINER
;
#define MAX_ZONE_CORNER_RADIUS
40
00
#define MAX_ZONE_CORNER_RADIUS
_MILS 4
00
/**
/**
...
@@ -83,8 +83,8 @@ public:
...
@@ -83,8 +83,8 @@ public:
void
SetCornerRadius
(
int
aRadius
)
void
SetCornerRadius
(
int
aRadius
)
{
{
if
(
aRadius
>
M
AX_ZONE_CORNER_RADIUS
)
if
(
aRadius
>
M
ils2iu
(
MAX_ZONE_CORNER_RADIUS_MILS
)
)
cornerRadius
=
M
AX_ZONE_CORNER_RADIUS
;
cornerRadius
=
M
ils2iu
(
MAX_ZONE_CORNER_RADIUS_MILS
)
;
else
if
(
aRadius
<
0
)
else
if
(
aRadius
<
0
)
cornerRadius
=
0
;
cornerRadius
=
0
;
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