namespace rive
{
- struct TvgPoint
+ struct Point
{
float x, y;
- TvgPoint(int _x, int _y) : x(_x), y(_y) { }
};
struct TvgPaint
tvg::StrokeJoin join;
tvg::StrokeCap cap;
RenderPaintStyle style;
- bool isFill;
- bool isStroke;
- TvgPaint() : isFill(false), isStroke(false) {}
+ bool isFill = false;
+ bool isStroke = false;
};
class TvgRenderPath : public RenderPath
private:
Shape *m_Path;
vector<PathCommand> m_PathType;
- vector<TvgPoint> m_PathPoints;
- bool m_Pushed;
+ vector<Point> m_PathPoints;
+ bool m_Pushed = false;
public:
TvgRenderPath();
using namespace rive;
-TvgRenderPath::TvgRenderPath() : m_Pushed(false)
+TvgRenderPath::TvgRenderPath()
{
this->m_Path = tvg::Shape::gen().release();
}
void TvgRenderPath::moveTo(float x, float y)
{
m_PathType.push_back(PathCommand::MoveTo);
- m_PathPoints.push_back(TvgPoint(x, y));
+ m_PathPoints.push_back({x, y});
}
void TvgRenderPath::lineTo(float x, float y)
{
m_PathType.push_back(PathCommand::LineTo);
- m_PathPoints.push_back(TvgPoint(x, y));
+ m_PathPoints.push_back({x, y});
}
void TvgRenderPath::cubicTo(float ox, float oy, float ix, float iy, float x, float y)
{
m_PathType.push_back(PathCommand::CubicTo);
- m_PathPoints.push_back(TvgPoint(ox, oy));
- m_PathPoints.push_back(TvgPoint(ix, iy));
- m_PathPoints.push_back(TvgPoint(x, y));
+ m_PathPoints.push_back({ox, oy});
+ m_PathPoints.push_back({ix, iy});
+ m_PathPoints.push_back({x, y});
}
void TvgRenderPath::close()