Browse Source

修改两路径连续时不能合并 的问题

liulei 5 years ago
parent
commit
2410432e2b
2 changed files with 2 additions and 2 deletions
  1. 1 1
      card_path.cpp
  2. 1 1
      line.h

+ 1 - 1
card_path.cpp

@@ -325,7 +325,7 @@ static std::vector<base_path> init_path(std::vector<base_path> & ret,vertex_list
 				continue;
 			line_v ij=lj.projection(li);//重叠
 
-			if(ij.empty())
+			if(ij.empty()&&ij[0].empty()&&ij[0].empty())
 				continue;			
 
 			point p0=li.as_line().projection(v[ret[j][0]]);

+ 1 - 1
line.h

@@ -223,7 +223,7 @@ struct line_v:line//线段
 		if(o[1] < t[0] || t[1] < o[0])
 			return line_v(point(0,0),point(0,0));
 
-		return line_v(point::min(t[0],o[0]),point::max(t[1],o[1]));
+		return line_v(point::max(t[0],o[0]),point::min(t[1],o[1]));
 	}
 
 	bool empty()const