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
6153dadc
Commit
6153dadc
authored
Mar 11, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TRACK::GetBoundingBox() revised for when track clearance is displayed
parent
1bb2da51
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
11 deletions
+29
-11
change_log.txt
change_log.txt
+1
-0
class_track.cpp
pcbnew/class_track.cpp
+24
-3
deltrack.cpp
pcbnew/deltrack.cpp
+1
-6
drawpanel.cpp
share/drawpanel.cpp
+3
-2
No files found.
change_log.txt
View file @
6153dadc
...
...
@@ -26,6 +26,7 @@ email address.
PostDirtyRect().
* void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track ) now redraws
the screen after a net deletion.
* eeschema/dialog_find.cpp: set the initial keyboard focus to the text control
2008-Mar-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
...
...
pcbnew/class_track.cpp
View file @
6153dadc
...
...
@@ -42,6 +42,20 @@ void DbgDisplayTrackInfos( TRACK* track )
#endif
/**
* Function ShowClearance
* tests to see if the clearance border is drawn on the given track.
* @return bool - true if should draw clearance, else false.
*/
static
bool
ShowClearance
(
const
TRACK
*
aTrack
)
{
// maybe return true for (for tracks and vias, not for zone segments
return
(
DisplayOpt
.
DisplayTrackIsol
&&
(
aTrack
->
GetLayer
()
<=
LAST_COPPER_LAYER
)
&&
(
aTrack
->
Type
()
==
TYPETRACK
||
aTrack
->
Type
()
==
TYPEVIA
)
);
}
/**********************************************************/
TRACK
::
TRACK
(
BOARD_ITEM
*
StructFather
,
KICAD_T
idtype
)
:
BOARD_ITEM
(
StructFather
,
idtype
)
...
...
@@ -242,6 +256,12 @@ EDA_Rect TRACK::GetBoundingBox() const
xmin
=
MIN
(
m_Start
.
x
,
m_End
.
x
);
}
if
(
ShowClearance
(
this
)
)
{
// + 1 is for the clearance line itself.
radius
+=
g_DesignSettings
.
m_TrackClearence
+
1
;
}
ymax
+=
radius
;
xmax
+=
radius
;
...
...
@@ -249,7 +269,9 @@ EDA_Rect TRACK::GetBoundingBox() const
xmin
-=
radius
;
// return a rectangle which is [pos,dim) in nature. therefore the +1
return
EDA_Rect
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
return
ret
;
}
...
...
@@ -783,8 +805,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
}
/* Shows clearance (for tracks and vias, not for zone segments */
if
(
DisplayOpt
.
DisplayTrackIsol
&&
(
m_Layer
<=
LAST_COPPER_LAYER
)
&&
(
Type
()
==
TYPETRACK
||
Type
()
==
TYPEVIA
)
)
if
(
ShowClearance
(
this
)
)
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
...
...
pcbnew/deltrack.cpp
View file @
6153dadc
...
...
@@ -168,14 +168,9 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track )
if
(
segm
->
GetNet
()
!=
net_code_delete
)
break
;
// This works ok, but sometimes leaves stuff on screen. I think
// the erase rectangle is not large enough always.
// DrawPanel->PostDirtyRect( segm->GetBoundingBox() );
DrawPanel
->
PostDirtyRect
(
segm
->
GetBoundingBox
()
);
}
// Do this instead of PostDirtyRect() for now
DrawPanel
->
Refresh
(
TRUE
);
SaveItemEfface
(
trackList
,
ii
);
GetScreen
()
->
SetModify
();
test_1_net_connexion
(
DC
,
net_code_delete
);
...
...
share/drawpanel.cpp
View file @
6153dadc
...
...
@@ -274,8 +274,9 @@ void WinEDA_DrawPanel::PostDirtyRect( EDA_Rect aRect )
// Ensure the rectangle is large enough after truncations.
// The pcb units have finer granularity than the pixels, so it can happen
// that the rectangle is not large enough for the erase portion.
aRect
.
m_Size
.
x
+=
1
;
aRect
.
m_Size
.
y
+=
1
;
aRect
.
m_Size
.
x
+=
2
;
// += 1 is not enough!
aRect
.
m_Size
.
y
+=
2
;
// pass wxRect() via EDA_Rect::operator wxRect() overload
RefreshRect
(
aRect
,
TRUE
);
...
...
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