simple-svg
simple-svg copied to clipboard
Unused private field: scale
Getting this in warning in clang 8.0.1:
simple-svg.hpp:606:16: warning: private field 'scale' is not used [-Wunused-private-field]
fix:
diff --git a/simple_svg_1.0.0.hpp b/simple_svg_1.0.0.hpp
index c44c199..aca367e 100644
--- a/simple_svg_1.0.0.hpp
+++ b/simple_svg_1.0.0.hpp
@@ -454,9 +454,9 @@ namespace svg
{
public:
Path(Fill const & fill = Fill(), Stroke const & stroke = Stroke())
- : Shape(fill, stroke)
+ : Shape(fill, stroke)
{ startNewSubPath(); }
- Path(Stroke const & stroke = Stroke()) : Shape(Color::Transparent, stroke)
+ Path(Stroke const & stroke = Stroke()) : Shape(Color::Transparent, stroke)
{ startNewSubPath(); }
Path & operator<<(Point const & point)
{
@@ -575,7 +575,7 @@ namespace svg
public:
LineChart(Dimensions margin = Dimensions(), double scale = 1,
Stroke const & axis_stroke = Stroke(.5, Color::Purple))
- : axis_stroke(axis_stroke), margin(margin), scale(scale) { }
+ : axis_stroke(axis_stroke), margin(margin) { }
LineChart & operator<<(Polyline const & polyline)
{
if (polyline.points.empty())
@@ -603,7 +603,6 @@ namespace svg
private:
Stroke axis_stroke;
Dimensions margin;
- double scale;
std::vector<Polyline> polylines;
optional<Dimensions> getDimensions() const
I’ve not used this in many years. Please make a pull request.