Skip to content

Commit a0f06ef

Browse files
committed
ran dotnet format with fixups
1 parent 06c19f8 commit a0f06ef

8 files changed

Lines changed: 14 additions & 11 deletions

File tree

CSharpMath.Evaluation.Tests/EvaluationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public void Numbers(string input, string converted, string output) =>
7676
[InlineData(@"3\mathrm{aa}a", @"3\mathrm{aa}a", @"3a\mathrm{aa}")]
7777
[InlineData(@"3\mathrm{a}a", @"3aa", @"3a^2")]
7878
[InlineData(@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
79-
@"abcd\mathrm{e}fgh\cdot \mathrm{i}jklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
80-
// i is considered as a number instead of a variable, unlike other alphabets, so it is sorted to the front
79+
@"abcd\mathrm{e}fgh\cdot \mathrm{i}jklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
80+
// i is considered as a number instead of a variable, unlike other alphabets, so it is sorted to the front
8181
@"\mathrm{i}aAbBcCdD\mathrm{e}EfFgGhHIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ")]
8282
[InlineData(@"\alpha\beta\gamma\delta\epsilon\varepsilon\zeta\eta\theta\iota\kappa\varkappa" +
8383
@"\lambda\mu\nu\xi\omicron\pi\varpi\rho\varrho\sigma\varsigma\tau\upsilon\phi\varphi\chi" +

CSharpMath.Maui.Example/ExamplesPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static ExamplesPage() {
520520

521521
//Annotations
522522

523-
labels[49] = new MathView {
523+
labels[49] = new MathView {
524524
LaTeX = @"\underbrace{abcdefghklmnopqrst} _{eee}",
525525
HeightRequest = 112.5,
526526
FontSize = 22.5f

CSharpMath.Rendering.Tests/TestRenderingSharedData.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using System.Collections;
22
using System.Collections.Generic;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.Linq;
45
using System.Reflection;
56

67
namespace CSharpMath.Rendering.Tests {
7-
public abstract class TestRenderingSharedData<TThis> : IEnumerable<object[]> where TThis : TestRenderingSharedData<TThis> {
8+
public abstract class TestRenderingSharedData<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] TThis> : IEnumerable<object[]> where TThis : TestRenderingSharedData<TThis> {
89
public static IReadOnlyDictionary<string, string> AllConstants { get; } =
910
typeof(TThis)
1011
.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)

CSharpMath/Atom/Atoms/UnderAnnotation.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace CSharpMath.Atom.Atoms;
1+
namespace CSharpMath.Atom.Atoms;
22
/// <summary>
33
/// Abstract name of under annotations implementation \underbrace, \underbracket etc..
44
/// </summary>
@@ -21,12 +21,14 @@ protected override MathAtom CloneInside(bool finalize) =>
2121
public override string DebugString =>
2222
new System.Text.StringBuilder(@"\underbrace")
2323
.AppendInBracesOrLiteralNull(InnerList?.DebugString)
24-
.Append(UnderList is {Count: >0} ? $"_{{{UnderList?.DebugString}}}" : string.Empty)
24+
.Append(UnderList is { Count: > 0 } ? $"_{{{UnderList?.DebugString}}}" : string.Empty)
2525
.ToString();
2626
public bool EqualsUnderAnnotation(UnderAnnotation other) =>
2727
EqualsAtom(other) && InnerList.NullCheckingStructuralEquality(other.InnerList)
2828
&& UnderList.NullCheckingStructuralEquality(other.UnderList);
2929
public override bool Equals(object obj) =>
3030
obj is UnderAnnotation u ? EqualsUnderAnnotation(u) : false;
31+
32+
public override int GetHashCode() => (base.GetHashCode(), InnerList, UnderList).GetHashCode();
3133
// public override int GetHashCode() => (base.GetHashCode(), InnerList).GetHashCode();
3234
}

CSharpMath/Atom/LaTeXParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ static bool MathAtomToLaTeX(MathAtom atom, StringBuilder builder,
625625
MathListToLaTeX(underAnotation.InnerList, builder, currentFontStyle);
626626
builder.Append('}');
627627

628-
if (underAnotation.UnderList is {Count: >0}) {
628+
if (underAnotation.UnderList is { Count: > 0 }) {
629629
builder.Append("_{");
630630
MathListToLaTeX(underAnotation.UnderList, builder, currentFontStyle);
631631
builder.Append('}');

CSharpMath/Atom/MathList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class MathList : IMathObject, IList<MathAtom>, IReadOnlyList<MathAtom>, I
1616
public List<MathAtom> Atoms { get; private set; }
1717
public MathList() => Atoms = new List<MathAtom>();
1818
public MathList(IEnumerable<MathAtom> atoms) => Atoms = new List<MathAtom>(atoms);
19-
public MathList(params MathAtom[] atoms) => Atoms = new List<MathAtom>(atoms);
20-
19+
public MathList(params MathAtom[] atoms) => Atoms = new List<MathAtom>(atoms);
20+
2121
/// <returns>The last <see cref="MathAtom"/> that is not a <see cref="Comment"/>,
2222
/// or <see cref="null"/> when <see cref="Atoms"/> is empty.</returns>
2323
#if !NETSTANDARD2_0 && !NET45

CSharpMath/Display/Displays/UnderAnnotationDisplay.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace CSharpMath.Display.Displays;
88
public class UnderAnnotationDisplay<TFont, TGlyph> : IDisplay<TFont, TGlyph>
99
where TFont : IFont<TGlyph> {
1010
public UnderAnnotationDisplay(IDisplay<TFont, TGlyph> inner, IDisplay<TFont, TGlyph>? underList,
11-
IGlyphDisplay<TFont, TGlyph> annotationGlyph,
11+
IGlyphDisplay<TFont, TGlyph> annotationGlyph,
1212
float underListBasedDescent,
1313
PointF position) {
1414
Inner = inner;

CSharpMath/Display/Typesetter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ private UnderAnnotationDisplay<TFont, TGlyph> MakeUnderAnnotation(UnderAnnotatio
765765

766766
glyphDisplay!.Position = new PointF(_currentPosition.X, glyphDisplay!.Position.Y - lineShiftUp);
767767

768-
var delta = (glyphDisplay.Width - innerListDisplay.Width)/2;
768+
var delta = (glyphDisplay.Width - innerListDisplay.Width) / 2;
769769
innerListDisplay.Position = new PointF(_currentPosition.X + delta, _currentPosition.Y);
770770

771771
var glArray = new RentedArray<TGlyph>(annotationSingleGlyph);

0 commit comments

Comments
 (0)