Schematic and symbol text boxes.
Also fixes some plot bugs with arcs. Also moves polygonization of arcs (when required) in plotting code from 5 degrees to calculated based on ARC_HIGH_DEF. Fixes https://gitlab.com/kicad/code/kicad/issues/5017
This commit is contained in:
@@ -45,7 +45,6 @@
|
||||
#include <callback_gal.h>
|
||||
#include <math/util.h> // for KiROUND
|
||||
|
||||
|
||||
PLOTTER::PLOTTER( )
|
||||
{
|
||||
m_plotScale = 1;
|
||||
@@ -154,6 +153,49 @@ double PLOTTER::GetDashGapLenIU() const
|
||||
}
|
||||
|
||||
|
||||
void PLOTTER::Arc( const VECTOR2I& aCenter, const VECTOR2I& aStart, const VECTOR2I& aEnd,
|
||||
FILL_T aFill, int aWidth, int aMaxError )
|
||||
{
|
||||
EDA_ANGLE startAngle( aStart - aCenter );
|
||||
EDA_ANGLE endAngle( aEnd - aCenter );
|
||||
int radius = ( aStart - aCenter ).EuclideanNorm();
|
||||
int numSegs = GetArcToSegmentCount( radius, aMaxError, FULL_CIRCLE );
|
||||
EDA_ANGLE delta = ANGLE_360 / std::max( 8, numSegs );
|
||||
VECTOR2I start( aStart );
|
||||
VECTOR2I end( aEnd );
|
||||
VECTOR2I pt;
|
||||
|
||||
if( startAngle > endAngle )
|
||||
{
|
||||
if( endAngle < ANGLE_0 )
|
||||
endAngle.Normalize();
|
||||
else
|
||||
startAngle = startAngle.Normalize() - ANGLE_360;
|
||||
}
|
||||
|
||||
SetCurrentLineWidth( aWidth );
|
||||
MoveTo( start );
|
||||
|
||||
for( EDA_ANGLE ii = delta; startAngle + ii < endAngle; ii += delta )
|
||||
{
|
||||
pt = start;
|
||||
RotatePoint( pt, aCenter, -ii );
|
||||
|
||||
LineTo( pt );
|
||||
}
|
||||
|
||||
if( aFill == FILL_T::NO_FILL )
|
||||
{
|
||||
FinishTo( end );
|
||||
}
|
||||
else
|
||||
{
|
||||
LineTo( end );
|
||||
FinishTo( aCenter );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PLOTTER::Arc( const VECTOR2I& aCenter, const EDA_ANGLE& aStartAngle,
|
||||
const EDA_ANGLE& aEndAngle, int aRadius, FILL_T aFill, int aWidth )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user