Minor fix in zones_by_polygon.cpp: When editing a non copper zone, some settings were not those of the edited zone.

trigo.h: Add a useful double NormalizeAngleDegrees( double Angle, double aMin, double aMax ).
This commit is contained in:
jean-pierre charras 2018-03-14 18:48:55 +01:00
parent e4d512a293
commit e8df845b3f
2 changed files with 16 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -271,6 +271,17 @@ inline double NormalizeAngleRadiansPos( double Angle )
return Angle;
}
/// Normalize angle to be aMin < angle <= aMax
/// angle is in degrees
inline double NormalizeAngleDegrees( double Angle, double aMin, double aMax )
{
while( Angle < aMin )
Angle += 360.0;
while( Angle >= aMax )
Angle -= 360.0;
return Angle;
}
/// Add two angles (keeping the result normalized). T2 is here
// because most of the time it's an int (and templates don't promote in
// that way)

View File

@ -894,13 +894,12 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
else if( IsCopperLayer( aZone->GetLayer() ) )
{
// edit a zone on a copper layer
zoneInfo << *aZone;
edited = InvokeCopperZonesEditor( this, &zoneInfo );
}
else
{
zoneInfo << *aZone;
edited = InvokeNonCopperZonesEditor( this, aZone, &zoneInfo );
}
@ -989,6 +988,9 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
GetBoard()->GetConnectivity()->RecalculateRatsnest();
s_PickedList.ClearItemsList(); // s_ItemsListPicker is no longer owner of picked items
if( !IsGalCanvasActive() )
m_canvas->Refresh();
}