Skip to content

Commit d0c5554

Browse files
committed
A bit of cleanup.
1 parent 9544bf1 commit d0c5554

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/ImageSharp.Drawing/Processing/PathGradientBrush.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public PathGradientBrushApplicator(
259259

260260
if (this.edges.Count == 3)
261261
{
262-
if (!this.FindPointOnTriangle(
262+
if (!FindPointOnTriangle(
263263
this.edges[0].Start,
264264
this.edges[1].Start,
265265
this.edges[2].Start,
@@ -321,7 +321,7 @@ public PathGradientBrushApplicator(
321321
return closest;
322322
}
323323

324-
private bool FindPointOnTriangle(PointF v1, PointF v2, PointF v3, PointF point, out float u, out float v)
324+
private static bool FindPointOnTriangle(PointF v1, PointF v2, PointF v3, PointF point, out float u, out float v)
325325
{
326326
Vector2 e1 = v2 - v1;
327327
Vector2 e2 = v3 - v2;
@@ -342,13 +342,13 @@ private bool FindPointOnTriangle(PointF v1, PointF v2, PointF v3, PointF point,
342342
return false;
343343
}
344344

345-
// From Real-Time Collision Detection
345+
// From Real-Time Collision Detection
346346
// https://gamedev.stackexchange.com/questions/23743/whats-the-most-efficient-way-to-find-barycentric-coordinates
347347
float d00 = Vector2.Dot(e1, e1);
348-
float d01 = Vector2.Dot(e1, -e3);
349-
float d11 = Vector2.Dot(-e3, -e3);
348+
float d01 = -Vector2.Dot(e1, e3);
349+
float d11 = Vector2.Dot(e3, e3);
350350
float d20 = Vector2.Dot(pv1, e1);
351-
float d21 = Vector2.Dot(pv1, -e3);
351+
float d21 = -Vector2.Dot(pv1, e3);
352352
float denominator = (d00 * d11) - (d01 * d01);
353353
u = ((d11 * d20) - (d01 * d21)) / denominator;
354354
v = ((d00 * d21) - (d01 * d20)) / denominator;

0 commit comments

Comments
 (0)