Skip to content

Commit

Permalink
Removed unused private setters
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehonti Ramos committed Aug 3, 2023
1 parent d6f5763 commit c51a0f7
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 140 deletions.
9 changes: 4 additions & 5 deletions src/AvaloniaMath/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ public static byte[] RenderToPng(this TexFormula texForm,
PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(image));
using (var ms = new MemoryStream())
{
encoder.Save(ms);
return ms.ToArray();
}
using var ms = new MemoryStream();
encoder.Save(ms);
return ms.ToArray();
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions src/WpfMath/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ public static byte[] RenderToPng(this TexFormula texForm,
PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(image));

using (var ms = new MemoryStream())
{
encoder.Save(ms);
return ms.ToArray();
}
using var ms = new MemoryStream();

encoder.Save(ms);
return ms.ToArray();
}
}
}
12 changes: 2 additions & 10 deletions src/XamlMath.Shared/Boxes/GlueBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ public GlueBox(double space, double stretch, double shrink)
this.Shrink = shrink;
}

public double Stretch
{
get;
private set;
}
public double Stretch { get; }

public double Shrink
{
get;
private set;
}
public double Shrink { get; }

public override void RenderTo(IElementRenderer renderer, double x, double y)
{
Expand Down
30 changes: 5 additions & 25 deletions src/XamlMath.Shared/Boxes/OverUnderBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,17 @@ public OverUnderBox(Box baseBox, Box delimiterBox, Box? scriptBox, double kern,
(!over && scriptBox != null ? scriptBox.Height + scriptBox.Depth + kern : 0.0);
}

public Box BaseBox
{
get;
private set;
}
public Box BaseBox { get; }

public Box DelimiterBox
{
get;
private set;
}
public Box DelimiterBox { get; }

public Box? ScriptBox
{
get;
private set;
}
public Box? ScriptBox { get; }

// Kern between delimeter and Script.
public double Kern
{
get;
private set;
}
public double Kern { get; }

// True to draw delimeter and script over base; false to draw under base.
public bool Over
{
get;
private set;
}
public bool Over { get; }

public override void RenderTo(IElementRenderer renderer, double x, double y)
{
Expand Down
12 changes: 2 additions & 10 deletions src/XamlMath.Shared/CharFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ public CharFont(char character, int fontId)
this.FontId = fontId;
}

public char Character
{
get;
private set;
}
public char Character { get; }

public int FontId
{
get;
private set;
}
public int FontId { get; }
}
}
6 changes: 1 addition & 5 deletions src/XamlMath.Shared/DefaultTexFont.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ public DefaultTexFont(IFontProvider fontProvider, double size)

public bool SupportsMetrics => true;

public double Size
{
get;
private set;
}
public double Size { get; }

public ExtensionChar GetExtension(CharInfo charInfo, TexStyle style)
{
Expand Down
27 changes: 4 additions & 23 deletions src/XamlMath.Shared/ExtensionChar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,9 @@ public ExtensionChar(CharInfo? top, CharInfo? middle, CharInfo? bottom, CharInfo
this.Bottom = bottom;
}

public CharInfo? Top
{
get;
private set;
}

public CharInfo? Middle
{
get;
private set;
}

public CharInfo? Bottom
{
get;
private set;
}

public CharInfo? Repeat
{
get;
private set;
}
public CharInfo? Top { get; }
public CharInfo? Middle { get; }
public CharInfo? Bottom { get; }
public CharInfo? Repeat { get; }
}
}
27 changes: 4 additions & 23 deletions src/XamlMath.Shared/Glue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,10 @@ public Glue(double space, double stretch, double shrink, string name)
this.Name = name;
}

public double Space
{
get;
private set;
}

public double Stretch
{
get;
private set;
}

public double Shrink
{
get;
private set;
}

public string Name
{
get;
private set;
}
public double Space { get; }
public double Stretch { get; }
public double Shrink { get; }
public string Name { get; }

private Box CreateBox(TexEnvironment environment)
{
Expand Down
34 changes: 5 additions & 29 deletions src/XamlMath.Shared/TexFontInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,11 @@ public TexFontInfo(int fontId, IFontTypeface font, double xHeight, double space,
this.SkewCharacter = (char)1;
}

public int FontId
{
get;
private set;
}

public IFontTypeface Font
{
get;
private set;
}

public double XHeight
{
get;
private set;
}

public double Space
{
get;
private set;
}

public double Quad
{
get;
private set;
}
public int FontId { get; }
public IFontTypeface Font { get; }
public double XHeight { get; }
public double Space { get; }
public double Quad { get; }

// Skew character (used for positioning accents).
public char SkewCharacter
Expand Down
6 changes: 1 addition & 5 deletions src/XamlMath.Shared/TexPredefinedFormulaParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ public void Parse(

private class ReturnParser : IActionParser
{
public TexFormula? Result
{
get;
private set;
}
public TexFormula? Result { get; private set; }

public void Parse(
SourceSpan source,
Expand Down

0 comments on commit c51a0f7

Please sign in to comment.