update IsClosed() with Move

This commit is contained in:
BobLd
2020-04-02 20:37:35 +01:00
committed by Eliot Jones
parent d804a63905
commit 16a17f3b8d

View File

@@ -230,9 +230,8 @@
/// </summary> /// </summary>
public bool IsClosed() public bool IsClosed()
{ {
// need to check if filled -> true if filled
if (Commands.Any(c => c is Close)) return true; if (Commands.Any(c => c is Close)) return true;
var filtered = Commands.Where(c => c is Line || c is BezierCurve).ToList(); var filtered = Commands.Where(c => c is Line || c is BezierCurve || c is Move).ToList();
if (filtered.Count < 2) return false; if (filtered.Count < 2) return false;
if (!GetStartPoint(filtered.First()).Equals(GetEndPoint(filtered.Last()))) return false; if (!GetStartPoint(filtered.First()).Equals(GetEndPoint(filtered.Last()))) return false;
return true; return true;