Skip to content

Commit

Permalink
refactor(lines): update DebuggerDisplay, add Debug.Assert to ml ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
jirikostiha committed Oct 31, 2023
1 parent 756c6ff commit 843f874
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/GodotSharpSome.Drawing2D/Multiline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// <summary>
/// Multiline builder.
/// </summary>
[DebuggerDisplay("palette:{_penPalette.Count}, points:{_points.Count}")]
[DebuggerDisplay("palette:{_penPalette.Count}, segments:{Segments}, penkey:{PenKey}")]
public class Multiline
{
/// <summary> Default angle value for arrow head. </summary>
Expand Down Expand Up @@ -111,6 +111,7 @@ public Multiline(IList<Vector2> points, IList<(string Key, IStraightLineAppender
{
_points = points ?? new List<Vector2>();
_penPalette = palette;
Debug.Assert(palette.Count > 0, "Palette must have at least one item.");
_pen = palette[0].Pen;
_penKey = palette[0].Key;
}
Expand Down Expand Up @@ -510,7 +511,7 @@ public static IEnumerable<Vector2> RegularConvexPolygonVertices(Vector2 center,
for (int i = 0; i < verticesCount; i++)
{
angle = rotationAngle + segmentAngle * i;
yield return new Vector2(radius * Cos(angle) + center.X, radius * Sin(angle) + center.Y);
yield return new(radius * Cos(angle) + center.X, radius * Sin(angle) + center.Y);
}
}
}
Expand Down

0 comments on commit 843f874

Please sign in to comment.