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
2e94a708
Commit
2e94a708
authored
May 02, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zone_container GetBoundingBox() deployment
parent
267d4f2f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
5 deletions
+43
-5
change_log.txt
change_log.txt
+8
-0
class_zone.cpp
pcbnew/class_zone.cpp
+27
-0
class_zone.h
pcbnew/class_zone.h
+3
-0
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+5
-5
No files found.
change_log.txt
View file @
2e94a708
...
...
@@ -6,6 +6,14 @@ Please add newer entries at the top, list the date and your name with
email address.
2008-May-2 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
Added ZONE_CONTAINER::GetBoundingBox() and used it to clean up
ZONE_CONTAINER deletion. There is still a problem dragging a zone container
edge that I will not get to.
2008-May-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
...
...
pcbnew/class_zone.cpp
View file @
2e94a708
...
...
@@ -356,6 +356,33 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
}
EDA_Rect
ZONE_CONTAINER
::
GetBoundingBox
()
{
const
int
PRELOAD
=
500000
;
int
ymax
=
-
PRELOAD
;
int
ymin
=
PRELOAD
;
int
xmin
=
PRELOAD
;
int
xmax
=
-
PRELOAD
;
int
count
=
GetNumCorners
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
wxPoint
corner
=
GetCornerPosition
(
i
);
ymax
=
MAX
(
ymax
,
corner
.
y
);
xmax
=
MAX
(
xmax
,
corner
.
x
);
ymin
=
MIN
(
ymin
,
corner
.
y
);
xmin
=
MIN
(
xmin
,
corner
.
x
);
}
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
return
ret
;
}
/**********************************************************************************************/
void
ZONE_CONTAINER
::
DrawWhileCreateOutline
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
)
/***********************************************************************************************/
...
...
pcbnew/class_zone.h
View file @
2e94a708
...
...
@@ -73,6 +73,9 @@ public:
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
aDrawMode
,
const
wxPoint
&
offset
=
ZeroOffset
);
EDA_Rect
GetBoundingBox
();
/**
* Function DrawWhileCreateOutline
* Draws the zone outline when ir is created.
...
...
pcbnew/zones_by_polygon.cpp
View file @
2e94a708
...
...
@@ -353,7 +353,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
if
(
zone_container
->
m_Poly
->
GetNumCorners
()
<=
3
)
{
zone_container
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
DrawPanel
->
PostDirtyRect
(
zone_container
->
GetBoundingBox
()
);
Delete_Zone_Fill
(
DC
,
NULL
,
zone_container
->
m_TimeStamp
);
m_Pcb
->
Delete
(
zone_container
);
return
;
...
...
@@ -778,8 +778,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
{
int
ncont
=
zone_container
->
m_Poly
->
GetContour
(
zone_container
->
m_CornerSelection
);
if
(
DC
)
zone_container
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
EDA_Rect
dirty
=
zone_container
->
GetBoundingBox
();
Delete_Zone_Fill
(
DC
,
NULL
,
zone_container
->
m_TimeStamp
);
// Remove fill segments
...
...
@@ -789,9 +788,10 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
else
{
zone_container
->
m_Poly
->
RemoveContour
(
ncont
);
if
(
DC
)
zone_container
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
}
DrawPanel
->
PostDirtyRect
(
dirty
);
GetScreen
()
->
SetModify
();
}
...
...
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