Skip to content

Commit 3c29bf3

Browse files
committed
Remove CSharpMath.Structures namespace
1 parent 5ebb8a5 commit 3c29bf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+211
-304
lines changed

CSharpMath.Core.Example/BackEnd/JsonMathTable.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using CSharpMath.Display;
22
using CSharpMath.Display.FrontEnd;
3-
using CSharpMath.Structures;
43
using Newtonsoft.Json.Linq;
54
using System.Collections.Generic;
65
using System.Linq;
@@ -162,7 +161,7 @@ public override (IEnumerable<TGlyph> variants, int count) GetHorizontalVariantsF
162161
if (variantGlyphs is not JArray variantGlyphsArray) {
163162
var outputGlyph = GlyphNameProvider.GetGlyph(glyphName);
164163
if (!outputGlyph.Equals(rawGlyph))
165-
throw new InvalidCodePathException
164+
throw new Atom.InvalidCodePathException
166165
("GlyphNameProvider.GetGlyph(GlyphNameProvider.GetGlyphName(rawGlyph)) != rawGlyph");
167166
return (new TGlyph[] { outputGlyph }, 1);
168167
} else
@@ -214,7 +213,7 @@ public override float GetTopAccentAdjustment(TFont font, TGlyph glyph) {
214213
return FontUnitsToPt(font, nameValue.Value<int>());
215214
} else {
216215
// If no top accent is defined then it is the center of the advance width.
217-
using var glyphs = new Structures.RentedArray<TGlyph>(glyph);
216+
using var glyphs = new Atom.RentedArray<TGlyph>(glyph);
218217
var (_, Total) = GlyphBoundsProvider.GetAdvancesForGlyphs(font, glyphs.Result, 1);
219218
return Total / 2;
220219
}

CSharpMath.Core.Example/BackEnd/TestTypesettingContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace CSharpMath.Core.BackEnd {
22
using CSharpMath.Atom;
33
using TGlyph = System.Text.Rune;
44
public static class TestTypesettingContext {
5-
public static Structures.Result<Display.Displays.ListDisplay<TestFont, System.Text.Rune>>
5+
public static Result<Display.Displays.ListDisplay<TestFont, System.Text.Rune>>
66
CreateDisplay(string latex) =>
77
LaTeXParser.MathListFromLaTeX(latex).Bind(mathList =>
88
Display.Typesetter.CreateLine(

CSharpMath.Core.Example/Checker.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using ListDisplay = CSharpMath.Display.Displays.ListDisplay<CSharpMath.Core.BackEnd.TestFont, System.Text.Rune>;
55

66
namespace CSharpMath.Core {
7-
using Structures;
87
public class Checker {
98
/// <summary>Whether you want to view e.g. fraction lines and radical lines
109
/// despite viewing character positions with less clarity.</summary>
@@ -56,7 +55,7 @@ void AssignDisplay() {
5655
});
5756
}
5857
AssignDisplay();
59-
if (display == null) throw new InvalidCodePathException("display is still not assigned");
58+
if (display == null) throw new Atom.InvalidCodePathException("display is still not assigned");
6059
var x = ReadInt("Input Touch X (integer): ");
6160
var y = ReadInt("Input Touch Y (integer): ");
6261
Console.Clear();

CSharpMath.Core.Tests/Atom/DictionaryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Xunit;
2-
using CSharpMath.Structures;
2+
using CSharpMath.Atom;
33

44
namespace CSharpMath.Core.Tests {
55
public class DictionaryTests {

CSharpMath.Core.Tests/Atom/LaTeXParserTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,20 +1279,20 @@ public void TestTeX(string input) {
12791279
CheckAtom<Variable>("T", t => Assert.Equal(FontStyle.Roman, t.FontStyle)),
12801280
CheckAtom<Space>("", space => {
12811281
Assert.Equal(FontStyle.Roman, space.FontStyle);
1282-
var expected = -1 / 6f * Structures.Space.EmWidth;
1283-
Assert.Equal(expected.Length, space.Length);
1282+
var expected = -1 / 6f * Length.EmWidth;
1283+
Assert.Equal(expected.Amount, space.Length);
12841284
Assert.Equal(expected.IsMu, space.IsMu);
12851285
}),
12861286
CheckAtom<RaiseBox>("", raise => {
12871287
Assert.Equal(FontStyle.Roman, raise.FontStyle);
1288-
Assert.Equal(-1 / 2f * Structures.Space.ExHeight, raise.Raise);
1288+
Assert.Equal(-1 / 2f * Length.ExHeight, raise.Raise);
12891289
Assert.Collection(raise.InnerList,
12901290
CheckAtom<Variable>("E", e => Assert.Equal(FontStyle.Roman, e.FontStyle)));
12911291
}),
12921292
CheckAtom<Space>("", space => {
12931293
Assert.Equal(FontStyle.Roman, space.FontStyle);
1294-
var expected = -1 / 8f * Structures.Space.EmWidth;
1295-
Assert.Equal(expected.Length, space.Length);
1294+
var expected = -1 / 8f * Length.EmWidth;
1295+
Assert.Equal(expected.Amount, space.Length);
12961296
Assert.Equal(expected.IsMu, space.IsMu);
12971297
}),
12981298
CheckAtom<Variable>("X", x => Assert.Equal(FontStyle.Roman, x.FontStyle))

CSharpMath.Core.Tests/Atom/MathAtomTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void TestCopyAccent() {
154154
}
155155
[Fact]
156156
public void TestCopySpace() {
157-
var space = new Space(3 * CSharpMath.Structures.Space.Point);
157+
var space = new Space(3 * Length.Point);
158158
Assert.IsType<Space>(space);
159159

160160
var copy = space.Clone(false);

CSharpMath.Evaluation.Tests/EvaluationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
namespace CSharpMath.EvaluationTests {
77
using Atom;
8-
using CSharpMath.Structures;
98

109
public class EvaluationTests {
1110
internal static MathList ParseLaTeX(string latex) =>

CSharpMath.Evaluation/Evaluation.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace CSharpMath {
88
using System.Collections;
99
using Atom;
1010
using Atoms = Atom.Atoms;
11-
using Structures;
1211
using System.Numerics;
1312

1413
public static partial class Evaluation {

CSharpMath.Maui.Example/ClockPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void Draw(ICanvas canvas, RectF dirtyRect) {
5252
if (i % 5 == 0) {
5353
painter.LaTeX = labels[i / 5];
5454
if (!(painter.Measure(dirtyRect.Width) is { } measure))
55-
throw new Structures.InvalidCodePathException("Invalid LaTeX");
55+
throw new Atom.InvalidCodePathException("Invalid LaTeX");
5656
var θ = (90 - 6 * i) / 180f * MathF.PI;
5757
var (sinθ, cosθ) = MathF.SinCos(θ);
5858
painter.Draw((canvas, dirtyRect.Size),

CSharpMath.Maui.Example/EditorPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ await p.ShowPopupAsync(new VerticalStackLayout {
9595
atomTypes.Text = "Atom Types = " + string.Join
9696
(", ", viewModel.MathList.Select(x => x.GetType().Name));
9797
ranges.Text = "Ranges = " + string.Join
98-
(", ", (viewModel.Display ?? throw new Structures.InvalidCodePathException("Invalid LaTeX"))
98+
(", ", (viewModel.Display ?? throw new Atom.InvalidCodePathException("Invalid LaTeX"))
9999
.Displays.Select(x => x.Range));
100100
index.Text = "Index = " + viewModel.InsertionIndex;
101101
});

0 commit comments

Comments
 (0)