Skip to content

Commit 4a4a40d

Browse files
committed
Changing Uno to UWPUno, changing dependency properties to doubles
1 parent ca1dbdd commit 4a4a40d

File tree

93 files changed

+186
-3821
lines changed

Some content is hidden

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

93 files changed

+186
-3821
lines changed

CSharpMath.Rendering/FrontEnd/ICSharpMathAPI.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ public interface ICSharpMathAPI<TContent, TColor> where TContent : class {
99
TColor TextColor { get; set; }
1010
TColor ErrorColor { get; set; }
1111
///<summary>Unit of measure: points; Defaults to <see cref="FontSize"/>.</summary>
12-
float? ErrorFontSize { get; set; }
12+
double? ErrorFontSize { get; set; }
1313
bool DisplayErrorInline { get; set; }
1414
PaintStyle PaintStyle { get; set; }
15-
float Magnification { get; set; }
15+
double Magnification { get; set; }
1616
string? ErrorMessage { get; }
1717
#endregion Non-display-recreating properties
1818
#region Display-recreating properties
1919
/// <summary>Unit of measure: points</summary>
20-
float FontSize { get; set; }
20+
double FontSize { get; set; }
2121
System.Collections.Generic.IEnumerable<Typeface> LocalTypefaces { get; set; }
2222
Atom.LineStyle LineStyle { get; set; }
2323
TContent? Content { get; set; }

CSharpMath.Rendering/FrontEnd/MathPainter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override void UpdateDisplayCore(float unused) {
2525
public override void Draw(TCanvas canvas, TextAlignment alignment = TextAlignment.Center, Thickness padding = default, float offsetX = 0, float offsetY = 0) {
2626
var c = WrapCanvas(canvas);
2727
UpdateDisplay(float.NaN);
28-
DrawCore(c, Display, Display == null ? new PointF?() : IPainterExtensions.GetDisplayPosition(Display.Width, Display.Ascent, Display.Descent, FontSize, c.Width, c.Height, alignment, padding, offsetX, offsetY));
28+
DrawCore(c, Display, Display == null ? new PointF?() : IPainterExtensions.GetDisplayPosition(Display.Width, Display.Ascent, Display.Descent, (float)FontSize, c.Width, c.Height, alignment, padding, offsetX, offsetY));
2929
}
3030
public void Draw(TCanvas canvas, float x, float y) {
3131
var c = WrapCanvas(canvas);

CSharpMath.Rendering/FrontEnd/Painter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ public Painter() {
3030
/// Unit of measure: points;
3131
/// Defaults to <see cref="FontSize"/>.
3232
/// </summary>
33-
public float? ErrorFontSize { get; set; }
33+
public double? ErrorFontSize { get; set; }
3434
public bool DisplayErrorInline { get; set; } = true;
3535
public TColor ErrorColor { get; set; }
3636
public TColor TextColor { get; set; }
3737
public TColor HighlightColor { get; set; }
3838
public (TColor glyph, TColor textRun)? GlyphBoxColor { get; set; }
3939
public PaintStyle PaintStyle { get; set; } = PaintStyle.Fill;
40-
public float Magnification { get; set; } = 1;
40+
public double Magnification { get; set; } = 1;
4141
public string? ErrorMessage { get; protected set; }
4242
public abstract IDisplay<Fonts, Glyph>? Display { get; protected set; }
4343
#endregion Non-redisplaying properties
@@ -47,9 +47,9 @@ public Painter() {
4747
protected abstract void SetRedisplay();
4848
protected Fonts Fonts { get; private set; } = new Fonts(Array.Empty<Typeface>(), DefaultFontSize);
4949
/// <summary>Unit of measure: points</summary>
50-
public float FontSize { get => Fonts.PointSize; set { Fonts = new Fonts(Fonts, value); SetRedisplay(); } }
50+
public double FontSize { get => Fonts.PointSize; set { Fonts = new Fonts(Fonts, (float)value); SetRedisplay(); } }
5151
IEnumerable<Typeface> __localTypefaces = Array.Empty<Typeface>();
52-
public IEnumerable<Typeface> LocalTypefaces { get => __localTypefaces; set { Fonts = new Fonts(value, FontSize); __localTypefaces = value; SetRedisplay(); } }
52+
public IEnumerable<Typeface> LocalTypefaces { get => __localTypefaces; set { Fonts = new Fonts(value, (float)FontSize); __localTypefaces = value; SetRedisplay(); } }
5353
Atom.LineStyle __style = Atom.LineStyle.Display;
5454
public Atom.LineStyle LineStyle { get => __style; set { __style = value; SetRedisplay(); } }
5555
TContent? __content;
@@ -74,7 +74,7 @@ protected void UpdateDisplay(float textPainterCanvasWidth) {
7474
UpdateDisplayCore(textPainterCanvasWidth);
7575
if (Display == null && DisplayErrorInline && ErrorMessage != null) {
7676
var font = Fonts;
77-
if (ErrorFontSize is { } errorSize) font = new Fonts(font, errorSize);
77+
if (ErrorFontSize is { } errorSize) font = new Fonts(font, (float)errorSize);
7878
var errorLines = ErrorMessage.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
7979
var runs = new List<Display.Displays.TextRunDisplay<Fonts, Glyph>>();
8080
float y = 0;
@@ -116,7 +116,7 @@ protected void DrawCore(ICanvas canvas, IDisplay<Fonts, Glyph>? display, PointF?
116116
canvas.Save();
117117
//invert the canvas vertically: displays are drawn with mathematical coordinates, not graphical coordinates
118118
canvas.Scale(1, -1);
119-
canvas.Scale(Magnification, Magnification);
119+
canvas.Scale((float)Magnification, (float)Magnification);
120120
if (position is { } p) display.Position = new PointF(p.X, p.Y);
121121
canvas.DefaultColor = WrapColor(TextColor);
122122
canvas.CurrentColor = WrapColor(HighlightColor);

CSharpMath.Rendering/FrontEnd/TextPainter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private void DrawCore(TCanvas canvas, float? width, TextAlignment alignment,
5656
System.Math.Max(_relativeXCoordDisplay.Width, _absoluteXCoordDisplay.Width),
5757
System.Math.Max(_relativeXCoordDisplay.Ascent, _absoluteXCoordDisplay.Ascent),
5858
System.Math.Max(_relativeXCoordDisplay.Descent, _absoluteXCoordDisplay.Descent),
59-
FontSize, width ?? c.Width,
59+
(float)FontSize, width ?? c.Width,
6060
c.Height, alignment, padding, offsetX, offsetY
6161
));
6262
var adjustedCanvasWidth =

CSharpMath.SkiaSharp.Wasm/CSharpMath.SkiaSharp.Wasm.csproj

Lines changed: 0 additions & 22 deletions
This file was deleted.

CSharpMath.Uno.Example/CSharpMath.Uno.Example.Droid/Assets/AboutAssets.txt

Lines changed: 0 additions & 19 deletions
This file was deleted.
Binary file not shown.

CSharpMath.Uno.Example/CSharpMath.Uno.Example.Droid/CSharpMath.Uno.Example.Droid.csproj

Lines changed: 0 additions & 114 deletions
This file was deleted.

CSharpMath.Uno.Example/CSharpMath.Uno.Example.Droid/Main.cs

Lines changed: 0 additions & 43 deletions
This file was deleted.

CSharpMath.Uno.Example/CSharpMath.Uno.Example.Droid/MainActivity.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)