Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<AvaloniaResource Include="**\*.xaml" />
<EmbeddedResource Include="..\Icon.png" Link="Icon.png" />
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)" />
<ProjectReference Include="..\CSharpMath.Avalonia\CSharpMath.Avalonia.csproj" />
<ProjectReference Include="..\CSharpMath.Evaluation\CSharpMath.Evaluation.csproj" />
Expand Down
3 changes: 0 additions & 3 deletions CSharpMath.Avalonia.Example/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public MainWindow() {
.GetManifestResourceStream("CSharpMath.Avalonia.Example.Icon.png");
if (stream != null)
Icon = new WindowIcon(stream);
#if DEBUG
this.AttachDevTools();
#endif
}

private void InitializeComponent() {
Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Avalonia/CSharpMath.Avalonia.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Description>The Avalonia front end for CSharpMath.</Description>
<PackageTags>$(PackageTags) avalonia</PackageTags>
<DefineConstants>$(DefineConstants) Avalonia</DefineConstants>
Expand Down
21 changes: 4 additions & 17 deletions CSharpMath.Avalonia/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Avalonia;
using Avalonia.Media;
using Avalonia.Media.Imaging;
Expand Down Expand Up @@ -25,22 +26,6 @@ internal static CSharpMathTextAlignment ToCSharpMathTextAlignment(this AvaloniaT
public static SolidColorBrush ToSolidColorBrush(this System.Drawing.Color color) =>
new SolidColorBrush(color.ToAvaloniaColor());

class DrawVisual<TContent> : Visual where TContent : class {
readonly Painter<AvaloniaCanvas, TContent, AvaloniaColor> painter;
readonly System.Drawing.RectangleF measure;
readonly CSharpMathTextAlignment alignment;
public DrawVisual(Painter<AvaloniaCanvas, TContent, AvaloniaColor> painter,
System.Drawing.RectangleF measure, CSharpMathTextAlignment alignment) {
this.painter = painter;
this.measure = measure;
this.alignment = alignment;
}
public override void Render(DrawingContext context) {
base.Render(context);
var canvas = new AvaloniaCanvas(context, new Size(measure.Width, measure.Height));
painter.Draw(canvas, alignment);
}
}
public static void DrawAsPng<TContent>
(this Painter<AvaloniaCanvas, TContent, AvaloniaColor> painter,
System.IO.Stream target,
Expand All @@ -53,7 +38,9 @@ public static void DrawAsPng<TContent>
if (size.Height is 0) size.Height = 1;
using var bitmap =
new RenderTargetBitmap(new PixelSize((int)size.Width, (int)size.Height));
bitmap.Render(new DrawVisual<TContent>(painter, size, alignmentForTests));
using var context = bitmap.CreateDrawingContext();
var canvas = new AvaloniaCanvas(context, new Size(size.Width, size.Height));
painter.Draw(canvas, alignmentForTests);
bitmap.Save(target, quality);
}
}
Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Evaluation/Evaluation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ string GreekToLaTeXCommandName(string n) =>
}
goto exitFor;
}
exitFor:
exitFor:
(next, error) =
bracketArgument == null
? Transform(mathList, ref i, Precedence.FunctionApplication)
Expand Down
4 changes: 3 additions & 1 deletion CSharpMath.Maui.Example/CSharpMath.Maui.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>

<!-- Use Microsoft.Maui.Controls from CSharpMath.Maui instead of here -->
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
</PropertyGroup>

<ItemGroup>
Expand All @@ -63,7 +66,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="10.0.20" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0" />
<PackageReference Include="SharpHook" Version="7.1.1" Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'ios' AND $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'android'" />
<PackageReference Include="CommunityToolkit.Maui" Version="13.0.0" />
Expand Down
2 changes: 0 additions & 2 deletions CSharpMath.Rendering.Tests/CSharpMath.Rendering.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<Compile Include="..\CSharpMath.Core.Tests\Display\ApproximateAssertions.cs" Link="ApproximateAssertions.cs" />
<ProjectReference Include="..\CSharpMath.Avalonia\CSharpMath.Avalonia.csproj" />
<ProjectReference Include="..\CSharpMath.SkiaSharp\CSharpMath.SkiaSharp.csproj" />
<PackageReference Include="SkiaSharp" Version="3.119.1" />
<PackageReference Condition="$([System.OperatingSystem]::IsLinux())" Include="SkiaSharp.NativeAssets.Linux" Version="3.119.1" />
<PackageReference Include="Avalonia.Skia" Version="$(AvaloniaVersion)" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion CSharpMath.SkiaSharp/CSharpMath.SkiaSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SkiaSharp" Version="3.119.1" />
<PackageReference Include="SkiaSharp" Version="3.119.3-preview.1.1" />
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SkiaSharp is updated to a preview package (3.119.3-preview.1.1). Preview dependencies can be unstable and may not be acceptable for a published library package. If this is only needed to match Avalonia 12 RC, consider pinning to a stable SkiaSharp version (if compatible) or clearly isolating/preventing shipping of preview dependencies in release packages.

Suggested change
<PackageReference Include="SkiaSharp" Version="3.119.3-preview.1.1" />
<PackageReference Include="SkiaSharp" Version="2.88.6" />

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this review. Either use 3.119.2 or delay the PR until 3.119.3 release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<ProjectReference Include="..\CSharpMath.Rendering\CSharpMath.Rendering.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion CSharpMath.Xaml.Tests/TestAvalonia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class TestAvalonia
protected override BindingMode TwoWay => BindingMode.TwoWay;
protected override TView ParseFromXaml<TView>(string xaml) => AvaloniaRuntimeXamlLoader.Parse<TView>(xaml);
protected override IDisposable SetBinding(Control view, AvaloniaProperty property, string viewModelProperty, BindingMode bindingMode) =>
view.Bind(property, new Binding(viewModelProperty, bindingMode));
view.Bind(property, new Binding(viewModelProperty) { Mode = bindingMode });
protected override void SetBindingContext(Control view, object viewModel) =>
view.DataContext = viewModel;
}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<PropertyGroup>
<!--CSharpMath-specific properties for centralized control of values-->
<AvaloniaVersion>11.3.9</AvaloniaVersion>
<AvaloniaVersion>12.0.0-rc1</AvaloniaVersion>
<IsPublishedPackage>true</IsPublishedPackage>
<IsPublishedPackage Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(MSBuildProjectName), `(Tests(.FSharp)?|Benchmarks|Example)$`))">false</IsPublishedPackage>

Expand Down
Loading