Fixed a subtle problem in zone filling calculations (see changelog)

This commit is contained in:
charras
2008-09-12 10:31:32 +00:00
parent b92dc298e4
commit e44bf71268
4 changed files with 51 additions and 28 deletions
+8 -8
View File
@@ -145,9 +145,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.x = pos.x / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = pos.y / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
@@ -167,9 +167,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.x = pos.x / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = pos.y / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
@@ -181,9 +181,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.x = pos.x / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = pos.y / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
@@ -277,9 +277,9 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.x = pos.x / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = pos.y / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
OrCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM, CELL_is_ZONE );