refactor stroke drawing
This commit is contained in:
@@ -99,11 +99,11 @@ bool point_side(glm::vec2 a, glm::vec2 b, glm::vec2 p)
|
||||
// a is a convex polygon
|
||||
// a and b are a list of non repeating points
|
||||
// returns the resulting intersection polygon points
|
||||
std::vector<vertex_t> poly_intersect(const std::vector<vertex_t>& poly, const std::vector<glm::vec2>& clip)
|
||||
std::vector<vertex_t> poly_intersect(const vertex_t* poly_begin, const vertex_t* poly_end, const std::vector<glm::vec2>& clip)
|
||||
{
|
||||
// implementing the Sutherland-Hodgman algorithm
|
||||
// see https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm
|
||||
std::vector<vertex_t> ret = poly;
|
||||
std::vector<vertex_t> ret(poly_begin, poly_end);
|
||||
for (int i = 0; i < clip.size(); i++)
|
||||
{
|
||||
std::vector<vertex_t> tmp;
|
||||
|
||||
Reference in New Issue
Block a user