#include "ClosePath.h" #include "../shape/Line.h" std::vector> ClosePath::absolute(SvgState& state, std::vector& args) { return parseClosePath(state, args); } std::vector> ClosePath::relative(SvgState& state, std::vector& args) { return parseClosePath(state, args); } std::vector> ClosePath::parseClosePath(SvgState& state, std::vector& args) { auto shapes = std::vector>(); if (state.currPoint.x != state.initialPoint.x || state.currPoint.y != state.initialPoint.y) { state.currPoint = state.initialPoint; shapes.push_back(std::make_unique(state.currPoint.x, state.currPoint.y, state.initialPoint.x, state.initialPoint.y)); } return shapes; }