@@ -43,8 +43,7 @@ public sealed class Contour
43
43
public int HoleCount => this . holes . Count ;
44
44
45
45
/// <summary>
46
- /// Gets a value indicating whether the contour
47
- /// is external (not a hole).
46
+ /// Gets a value indicating whether the contour is external (not a hole).
48
47
/// </summary>
49
48
public bool IsExternal => this . HoleOf == null ;
50
49
@@ -127,12 +126,12 @@ public bool IsCounterClockwise()
127
126
{
128
127
c = points [ i ] ;
129
128
c1 = points [ i + 1 ] ;
130
- area += ( c . X * c1 . Y ) - ( c1 . X * c . Y ) ;
129
+ area += Vertex . Cross ( c , c1 ) ;
131
130
}
132
131
133
- c = points [ this . points . Count - 1 ] ;
132
+ c = points [ ^ 1 ] ;
134
133
c1 = points [ 0 ] ;
135
- area += ( c . X * c1 . Y ) - ( c1 . X * c . Y ) ;
134
+ area += Vertex . Cross ( c , c1 ) ;
136
135
return this . cc = area >= 0 ;
137
136
}
138
137
@@ -176,11 +175,11 @@ public void SetCounterClockwise()
176
175
}
177
176
178
177
/// <summary>
179
- /// Offsets the contour by the specified x and y values.
178
+ /// Translates the contour by the specified x and y values.
180
179
/// </summary>
181
180
/// <param name="x">The x-coordinate offset.</param>
182
181
/// <param name="y">The y-coordinate offset.</param>
183
- public void Offset ( double x , double y )
182
+ public void Translate ( double x , double y )
184
183
{
185
184
List < Vertex > points = this . points ;
186
185
for ( int i = 0 ; i < points . Count ; i ++ )
0 commit comments