Skip to content

Commit 5b2434f

Browse files
committed
Font size align type with underlying win2d CanvasTestFormat int -> float
Note: Control.FontSize is a double, perhaps win2d should allign with this and this should be changed to doulbe then.
1 parent f9837b5 commit 5b2434f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Media/InfiniteCanvas/Commands/InfiniteCanvasCreateTextBoxCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class InfiniteCanvasCreateTextBoxCommand : IInfiniteCanvasCommand
1212
private readonly List<IDrawable> _drawableList;
1313
private readonly TextDrawable _drawable;
1414

15-
public InfiniteCanvasCreateTextBoxCommand(List<IDrawable> drawableList, double x, double y, double width, double height, int textFontSize, string text, Color color, bool isBold, bool isItalic)
15+
public InfiniteCanvasCreateTextBoxCommand(List<IDrawable> drawableList, double x, double y, double width, double height, float textFontSize, string text, Color color, bool isBold, bool isItalic)
1616
{
1717
_drawable = new TextDrawable(
1818
x,

Microsoft.Toolkit.Uwp.UI.Controls.Media/InfiniteCanvas/Controls/InfiniteCanvasVirtualDrawingSurface.Commands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ internal void ExecuteUpdateTextBoxFontSize(float newValue)
7979
ExecuteCommand(command);
8080
}
8181

82-
internal void ExecuteCreateTextBox(double x, double y, double width, double height, int textFontSize, string text, Color color, bool isBold, bool isItalic)
82+
internal void ExecuteCreateTextBox(double x, double y, double width, double height, float textFontSize, string text, Color color, bool isBold, bool isItalic)
8383
{
8484
var command = new InfiniteCanvasCreateTextBoxCommand(_drawableList, x, y, width, height, textFontSize, text, color, isBold, isItalic);
8585
ExecuteCommand(command);

Microsoft.Toolkit.Uwp.UI.Controls.Media/InfiniteCanvas/InfiniteCanvas.TextBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ public partial class InfiniteCanvas
3535

3636
private TextDrawable SelectedTextDrawable => _drawingSurfaceRenderer.GetSelectedTextDrawable();
3737

38-
private int _lastValidTextFontSizeValue = DefaultFontValue;
38+
private float _lastValidTextFontSizeValue = DefaultFontValue;
3939

40-
private int TextFontSize
40+
private float TextFontSize
4141
{
4242
get
4343
{
4444
if (!string.IsNullOrWhiteSpace(_canvasComboBoxFontSizeTextBox.SelectedValue.ToString()) &&
4545
Regex.IsMatch(_canvasComboBoxFontSizeTextBox.Text, "^[0-9]*$"))
4646
{
47-
var fontSize = int.Parse((_canvasComboBoxFontSizeTextBox.SelectedItem as ComboBoxItem).Content.ToString());
47+
var fontSize = float.Parse((_canvasComboBoxFontSizeTextBox.SelectedItem as ComboBoxItem).Content.ToString());
4848
_lastValidTextFontSizeValue = fontSize;
4949
}
5050

0 commit comments

Comments
 (0)