Font size field type fix (#190)

* Font size field type fix

Font size value is used as a float. Wrong type here causes exceptions.

* Fix for converters
This commit is contained in:
MXI 2020-05-11 00:05:19 +03:00 committed by GitHub
commit 4d917daccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
// Greenshot - a free and open source screenshot tool
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
@ -37,7 +37,7 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Fields.Binding
protected override float Convert(decimal o)
{
return System.Convert.ToInt16(o);
return System.Convert.ToSingle(o);
}
public static DecimalFloatConverter GetInstance()

View file

@ -1,4 +1,4 @@
// Greenshot - a free and open source screenshot tool
// Greenshot - a free and open source screenshot tool
// Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom
//
// For more information see: http://getgreenshot.org/
@ -37,7 +37,7 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Fields.Binding
protected override int Convert(decimal o)
{
return System.Convert.ToInt16(o);
return System.Convert.ToInt32(o);
}
public static DecimalIntConverter GetInstance()

View file

@ -59,7 +59,7 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Fields
/// <summary>
/// This field specifies the font size
/// </summary>
public static readonly IFieldType FONT_SIZE = new FieldType<int>("FONT_SIZE");
public static readonly IFieldType FONT_SIZE = new FieldType<float>("FONT_SIZE");
/// <summary>
/// This field specifies the horizontal text alignment
/// </summary>