Plot code cleaning.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file SVG_plotter.cpp
|
||||
* @brief Kicad: specialized plotter for SVG files format
|
||||
* @brief KiCad: specialized plotter for SVG files format
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -193,6 +193,7 @@ void SVG_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
|
||||
SetSvgCoordinatesFormat( 4, true );
|
||||
}
|
||||
|
||||
|
||||
void SVG_PLOTTER::SetSvgCoordinatesFormat( unsigned aResolution, bool aUseInches )
|
||||
{
|
||||
m_useInch = aUseInches;
|
||||
@@ -355,8 +356,7 @@ void SVG_PLOTTER::emitSetRGBColor( double r, double g, double b )
|
||||
m_graphics_changed = true;
|
||||
m_pen_rgb_color = rgb_color;
|
||||
|
||||
// Currently, use the same color for brush and pen
|
||||
// (i.e. to draw and fill a contour)
|
||||
// Currently, use the same color for brush and pen (i.e. to draw and fill a contour).
|
||||
m_brush_rgb_color = rgb_color;
|
||||
}
|
||||
}
|
||||
@@ -382,6 +382,7 @@ void SVG_PLOTTER::Rect( const wxPoint& p1, const wxPoint& p2, FILL_TYPE fill, in
|
||||
DPOINT org_dev = userToDeviceCoordinates( rect.GetOrigin() );
|
||||
DPOINT end_dev = userToDeviceCoordinates( rect.GetEnd() );
|
||||
DSIZE size_dev = end_dev - org_dev;
|
||||
|
||||
// Ensure size of rect in device coordinates is > 0
|
||||
// I don't know if this is a SVG issue or a Inkscape issue, but
|
||||
// Inkscape has problems with negative or null values for width and/or height, so avoid them
|
||||
@@ -554,7 +555,7 @@ void SVG_PLOTTER::BezierCurve( const wxPoint& aStart, const wxPoint& aControl1,
|
||||
start.x, start.y, ctrl1.x, ctrl1.y,
|
||||
ctrl2.x, ctrl2.y, end.x, end.y );
|
||||
#else
|
||||
PLOTTER::BezierCurve( aStart, aControl1,aControl2, aEnd,aTolerance, aLineThickness );
|
||||
PLOTTER::BezierCurve( aStart, aControl1, aControl2, aEnd, aTolerance, aLineThickness );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -811,6 +812,7 @@ void SVG_PLOTTER::Text( const wxPoint& aPos,
|
||||
}
|
||||
|
||||
wxSize text_size;
|
||||
|
||||
// aSize.x or aSize.y is < 0 for mirrored texts.
|
||||
// The actual text size value is the absolute value
|
||||
text_size.x = std::abs( GraphicTextWidth( aText, aSize, aItalic, aWidth ) );
|
||||
|
||||
Reference in New Issue
Block a user