Skip to content

Commit

Permalink
Converted CSharpMath.Ios to MSBuild.Sdk.Extras
Browse files Browse the repository at this point in the history
  • Loading branch information
Happypig375 committed Mar 18, 2020
1 parent bcfda8b commit aa2a5eb
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 148 deletions.
15 changes: 8 additions & 7 deletions CSharpMath.Avalonia/CSharpMath.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<PackageVersion>0.2.0</PackageVersion>
<PackageVersion>0.4.0-alpha</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageReleaseNotes>The 0.2.0 Editor Update brings an editor interface to CSharpMath.</PackageReleaseNotes>
<PackageReleaseNotes>The 0.4.0 Avalonia Update brings the Avalonia front end! Warning: Massive breaking changes!</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>5610427533fc4ed9f1fd86b07dda36dca6c65f67</RepositoryCommit>
<RepositoryCommit>bcfda8b3fd03020b51e4b59cadf7eda121831745</RepositoryCommit>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>https://github.com/verybadcat/CSharpMath/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/verybadcat/CSharpMath/master/Icon.png</PackageIconUrl>
<Copyright>© CSharpMath Contributors 2018</Copyright>
<Copyright>© CSharpMath Contributors 2020</Copyright>
<PackageId>CSharpMath.Avalonia</PackageId>
<Title>CSharpMath.Avalonia</Title>
<Description>The Avalonia front end for CSharpMath.</Description>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;avalonia</PackageTags>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;beautiful;avalonia</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Editor.TestChecker/Checker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ static int ReadInt(string message) {
string? latex = null;
while (true) {
try {
Console.SetBufferSize(Console.WindowWidth, Console.BufferHeight); // line wrapping
Console.Title = "CSharpMath.Editor Test Checker";
Console.Clear();
Console.SetBufferSize(Console.WindowWidth, Console.BufferHeight); // line wrapping
Console.ResetColor();
Console.WriteLine("Welcome to the CSharpMath.Editor Test Checker!");
Console.WriteLine();
Expand Down
61 changes: 61 additions & 0 deletions CSharpMath.Editor.Tests/IndexForPointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -579,5 +579,66 @@ public void Complex(PointF point, MathListIndex expected) =>
};
[Theory, MemberData(nameof(IntegralLimitsData))]
public void IntegralLimits(PointF point, MathListIndex expected) => Test(@"\int\limits_a^b x\ dx", point, expected);
public static TestData SummationData =>
new TestData {
{ (0, -100), 0 },
{ (0, -5), 0 },
{ (0, 0), 0 },
{ (0, 30), 0 },
{ (0, 100), 0 },
{ (10, -100), 1 },
{ (10, -5), 1 },
{ (10, 0), 1 },
{ (10, 30), 1 },
{ (10, 100), 1 },
{ (20, -100), 2 },
{ (20, -5), 2 },
{ (20, 0), 2 },
{ (20, 30), 2 },
{ (20, 100), 2 },
{ (25, -100), 2, (SubIndex.Subscript, 0) },
{ (25, -5), 2, (SubIndex.Subscript, 0) },
{ (25, 0), 2 },
{ (25, 30), 2, (SubIndex.Superscript, 0) },
{ (25, 100), 2, (SubIndex.Superscript, 0) },
{ (30, -100), 2, (SubIndex.Subscript, 1) },
{ (30, -5), 2, (SubIndex.Subscript, 1) },
{ (30, 0), 2 },
{ (30, 30), 2, (SubIndex.Superscript, 0) },
{ (30, 100), 2, (SubIndex.Superscript, 0) },
{ (35, -100), 2, (SubIndex.Subscript, 2) },
{ (35, -5), 2, (SubIndex.Subscript, 2) },
{ (35, 0), 2, (SubIndex.BetweenBaseAndScripts, 1) },
{ (35, 30), 2, (SubIndex.Superscript, 1) },
{ (35, 100), 2, (SubIndex.Superscript, 1) },
{ (40, -100), 2, (SubIndex.Subscript, 2) },
{ (40, -5), 2, (SubIndex.Subscript, 2) },
{ (40, 0), 3 },
{ (40, 30), 2, (SubIndex.Superscript, 2) },
{ (40, 100), 2, (SubIndex.Superscript, 2) },
{ (45, -100), 2, (SubIndex.Subscript, 3) },
{ (45, -5), 2, (SubIndex.Subscript, 3) },
{ (45, 0), 3 },
{ (45, 30), 2, (SubIndex.Superscript, 2) },
{ (45, 100), 2, (SubIndex.Superscript, 2) },
{ (50, -100), 3 },
{ (50, -5), 3 },
{ (50, 0), 3 },
{ (50, 30), 3 },
{ (50, 100), 3 },
{ (60, -100), 4 },
{ (60, -5), 4 },
{ (60, 0), 4 },
{ (60, 30), 4 },
{ (60, 100), 4 },
{ (70, -100), 5 },
{ (70, -5), 5 },
{ (70, 0), 5 },
{ (70, 30), 5 },
{ (70, 100), 5 },
};
[Theory, MemberData(nameof(SummationData))]
public void Summation(PointF point, MathListIndex expected) => Test(@"77 \sum_{777}^{77} 77", point, expected);

}
}
41 changes: 18 additions & 23 deletions CSharpMath.Editor.Tests/PointForIndexTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ public void RadicalDegree(PointF point, MathListIndex expected) =>
{ (97.676, 8.736), 4, (SubIndex.Degree, 1) },
{ (106.556, -6.8), 4, (SubIndex.Subscript, 0) },
{ (106.556, 0), 4, (SubIndex.Radicand, 1) },
{ (118.556, 10.02), 4, (SubIndex.Superscript, 0), (SubIndex.Subscript, 1) },
{ (113.556, -6.8), 4, (SubIndex.Subscript, 0), (SubIndex.BetweenBaseAndScripts, 1) },
{ (113.556, -2.754), 4, (SubIndex.Subscript, 0), (SubIndex.Superscript, 0) },
{ (118.556, -6.8), 4, (SubIndex.Subscript, 1) },
{ (118.556, -2.754), 4, (SubIndex.Subscript, 0), (SubIndex.Superscript, 1) },
{ (118.556, 10.02), 4, (SubIndex.Superscript, 0), (SubIndex.Subscript, 1) },
{ (118.556, 0), 5 }
};
[Theory, MemberData(nameof(ComplexData))]
Expand All @@ -170,10 +170,10 @@ public void Complex(PointF point, MathListIndex expected) =>
new TestData {
{ (0, 0), 0 },
{ (10, 0), 0, (SubIndex.BetweenBaseAndScripts, 1) },
{ (10, 9.68), 0, (SubIndex.Superscript, 0) },
{ (17, 9.68), 0, (SubIndex.Superscript, 1) },
{ (10, -6.12), 0, (SubIndex.Subscript, 0) },
{ (17, -6.12), 0, (SubIndex.Subscript, 1) },
{ (10, 9.68), 0, (SubIndex.Superscript, 0) },
{ (17, 9.68), 0, (SubIndex.Superscript, 1) },
{ (21.453, 0), 1 },
{ (31.453, 0), 2 },
{ (41.453, 0), 3 },
Expand All @@ -186,10 +186,10 @@ public void Complex(PointF point, MathListIndex expected) =>
new TestData {
{ (0, 0), 0 },
{ (10, 0), 0, (SubIndex.BetweenBaseAndScripts, 1) },
{ (1.5, 20.8), 0, (SubIndex.Superscript, 0) },
{ (8.5, 20.8), 0, (SubIndex.Superscript, 1) },
{ (1.5, -17.14), 0, (SubIndex.Subscript, 0) },
{ (8.5, -17.14), 0, (SubIndex.Subscript, 1) },
{ (1.5, 20.8), 0, (SubIndex.Superscript, 0) },
{ (8.5, 20.8), 0, (SubIndex.Superscript, 1) },
{ (13.333, 0), 1 },
{ (23.333, 0), 2 },
{ (33.333, 0), 3 },
Expand Down Expand Up @@ -221,25 +221,20 @@ public void Complex(PointF point, MathListIndex expected) =>
new TestData {
{ (0, 0), 0 },
{ (10, 0), 1 },
{ (20, 0), 2 },
{ (33.333, 0), 3 },
{ (62.833, 0), 3, (SubIndex.BetweenBaseAndScripts, 1) },
{ (54.333, 20.8), 3, (SubIndex.Superscript, 0) },
{ (61.333, 20.8), 3, (SubIndex.Superscript, 1) },
{ (33.333, -17.14), 3, (SubIndex.Subscript, 0) },
{ (40.333, -17.14), 3, (SubIndex.Subscript, 1) },
{ (47.333, -17.14), 3, (SubIndex.Subscript, 2) },
{ (54.333, -17.14), 3, (SubIndex.Subscript, 3) },
{ (61.333, -17.14), 3, (SubIndex.Subscript, 4) },
{ (68.333, -17.14), 3, (SubIndex.Subscript, 5) },
{ (75.333, -17.14), 3, (SubIndex.Subscript, 6) },
{ (82.333, -17.14), 3, (SubIndex.Subscript, 7) },
{ (85.666, 0), 4 },
{ (95.666, 0), 5 },
{ (105.666, 0), 6 },
{ (115.666, 0), 7 },
{ (23.333, 0), 2 },
{ (38.833, 0), 2, (SubIndex.BetweenBaseAndScripts, 1) },
{ (23.333, -17.14), 2, (SubIndex.Subscript, 0) },
{ (30.333, -17.14), 2, (SubIndex.Subscript, 1) },
{ (37.333, -17.14), 2, (SubIndex.Subscript, 2) },
{ (44.333, -17.14), 2, (SubIndex.Subscript, 3) },
{ (26.833, 20.8), 2, (SubIndex.Superscript, 0) },
{ (33.833, 20.8), 2, (SubIndex.Superscript, 1) },
{ (40.833, 20.8), 2, (SubIndex.Superscript, 2) },
{ (47.666, 0), 3 },
{ (57.666, 0), 4 },
{ (67.666, 0), 5 },
};
[Theory, MemberData(nameof(SummationData))]
public void Summation(PointF point, MathListIndex expected) => Test(@"777 \sum_{7777777}^7 777", point, expected);
public void Summation(PointF point, MathListIndex expected) => Test(@"77 \sum_{777}^{77} 77", point, expected);
}
}
10 changes: 5 additions & 5 deletions CSharpMath.Editor/CSharpMath.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<PackageVersion>0.3.0</PackageVersion>
<PackageReleaseNotes>The 0.3.0 Clickity Update brings a clickable math editor!</PackageReleaseNotes>
<PackageVersion>0.4.0-alpha</PackageVersion>
<PackageReleaseNotes>The 0.4.0 Avalonia Update brings the Avalonia front end! Warning: Massive breaking changes!</PackageReleaseNotes>
<Description>The base code for a What You See Is What You Get math editor.</Description>
<PackageId>CSharpMath.Editor</PackageId>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;edit;editing;editor;WYSIWYG</PackageTags>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;beautiful;edit;editing;editor;WYSIWYG</PackageTags>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<Title>CSharpMath.Editor</Title>
<PackageIcon>Icon.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>3f4e8d3f9b5bcf39bfc425f8a7d8a29ea06a1c84</RepositoryCommit>
<RepositoryCommit>bcfda8b3fd03020b51e4b59cadf7eda121831745</RepositoryCommit>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>© CSharpMath Contributors 2019</Copyright>
<Copyright>© CSharpMath Contributors 2020</Copyright>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CSharpMath\CSharpMath.csproj" />
Expand Down
9 changes: 6 additions & 3 deletions CSharpMath.Editor/Extensions/LargeOpLimitsDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ public static MathListIndex IndexForPoint<TFont, TGlyph>(
PointF point) where TFont : IFont<TGlyph> =>
// We can be before or after the large operator
point.X < self.Position.X - PixelDelta
//We are before the large operator, so
// We are before the large operator, so
? MathListIndex.Level0Index(self.Range.Location)
: point.X > self.Position.X + self.Width + PixelDelta
//We are after the large operator
// We are after the large operator
? MathListIndex.Level0Index(self.Range.End)
: self.UpperLimit is { } u && point.Y > self.Position.Y + u.Position.Y - PixelDelta
? MathListIndex.IndexAtLocation(self.Range.Location,
MathListSubIndexType.Superscript, u.IndexForPoint(context, point))
: self.LowerLimit is { } l && point.Y < self.Position.Y + l.Position.Y + l.DisplayBounds().Height + PixelDelta
? MathListIndex.IndexAtLocation(self.Range.Location,
MathListSubIndexType.Subscript, l.IndexForPoint(context, point))
: point.X > self.Position.X + self.Width / 2
: point.X > self.Position.X + self.Width * 3 / 4
? MathListIndex.Level0Index(self.Range.End)
: point.X > self.Position.X + self.Width / 2
? MathListIndex.IndexAtLocation(self.Range.Location,
MathListSubIndexType.BetweenBaseAndScripts, MathListIndex.Level0Index(1))
: MathListIndex.Level0Index(self.Range.Location);

public static PointF? PointForIndex<TFont, TGlyph>(
Expand Down
10 changes: 5 additions & 5 deletions CSharpMath.Forms/CSharpMath.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<PackageVersion>0.3.0</PackageVersion>
<PackageVersion>0.4.0-alpha</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<PackageReleaseNotes>The 0.3.0 Clickity Update brings a clickable math editor!</PackageReleaseNotes>
<PackageReleaseNotes>The 0.4.0 Avalonia Update brings the Avalonia front end! Warning: Massive breaking changes!</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>3f4e8d3f9b5bcf39bfc425f8a7d8a29ea06a1c84</RepositoryCommit>
<RepositoryCommit>bcfda8b3fd03020b51e4b59cadf7eda121831745</RepositoryCommit>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>Icon.png</PackageIcon>
<Copyright>© CSharpMath Contributors 2019</Copyright>
<Copyright>© CSharpMath Contributors 2020</Copyright>
<PackageId>CSharpMath.Forms</PackageId>
<Title>CSharpMath.Forms</Title>
<Description>The Xamarin.Forms front end for CSharpMath.</Description>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;forms;xamarin.forms;xamarin</PackageTags>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;beautiful;forms;xamarin.forms;xamarin</PackageTags>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
28 changes: 10 additions & 18 deletions CSharpMath.Ios/CSharpMath.Ios.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFramework>xamarin.ios1.0</TargetFramework>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
Expand All @@ -11,25 +12,24 @@
<RootNamespace>CSharpMath.Ios</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>CSharpMath.Ios</AssemblyName>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<NuGetPackageImportStamp></NuGetPackageImportStamp>
<PackOnBuild>true</PackOnBuild>
<PackageId>CSharpMath.Ios</PackageId>
<PackageVersion>0.3.0</PackageVersion>
<PackageVersion>0.4.0-alpha</PackageVersion>
<Authors>CSharpMath Contributors (verybadcat, Happypig375, charlesroddie, FoggyFinder)</Authors>
<NeutralLanguage>en</NeutralLanguage>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/verybadcat/CSharpMath</PackageProjectUrl>
<PackageReleaseNotes>The 0.3.0 Clickity Update brings a clickable math editor!</PackageReleaseNotes>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;ios;xamarin</PackageTags>
<PackageReleaseNotes>The 0.4.0 Avalonia Update brings the Avalonia front end! Warning: Massive breaking changes!</PackageReleaseNotes>
<PackageTags>math;mathematics;mathematical;formula;equation;equations;expression;tex;latex;render;rendering;display;beautiful;ios;xamarin</PackageTags>
<Title>CSharpMath.Ios</Title>
<Description>The iOS front end for CSharpMath.</Description>
<Copyright>© CSharpMath Contributors 2019</Copyright>
<Copyright>© CSharpMath Contributors 2020</Copyright>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/verybadcat/CSharpMath.git</RepositoryUrl>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'Release'">true</GeneratePackageOnBuild>
<RepositoryBranch>master</RepositoryBranch>
<RepositoryCommit>3f4e8d3f9b5bcf39bfc425f8a7d8a29ea06a1c84</RepositoryCommit>
<RepositoryCommit>bcfda8b3fd03020b51e4b59cadf7eda121831745</RepositoryCommit>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageIcon>Icon.png</PackageIcon>
</PropertyGroup>
Expand Down Expand Up @@ -64,9 +64,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
</Reference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS">
Expand All @@ -82,13 +80,7 @@
</ItemGroup>
<ItemGroup>
<None Include="../Icon.png" Pack="true" PackagePath="" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="IosMathLabels.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Remove="packages.config" />
</ItemGroup>
<Import Project="..\CSharpMath.Apple\CSharpMath.Apple.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\NuGet.Build.Packaging.0.2.2\build\NuGet.Build.Packaging.targets" Condition="Exists('..\packages\NuGet.Build.Packaging.0.2.2\build\NuGet.Build.Packaging.targets') And '$(Configuration)' == 'Release-iOS'" />
</Project>
35 changes: 0 additions & 35 deletions CSharpMath.Ios/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit aa2a5eb

Please sign in to comment.