mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
[Settings] Changed ImageSize class to parse as double instead of int (#6299)
* Changed ImageSize class to parse as double instead of int * Tweaked fix to resolve empty ImageResizer box fix
This commit is contained in:
@@ -141,15 +141,18 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
set
|
||||
{
|
||||
int newWidth = -1;
|
||||
int.TryParse(value + string.Empty, out newWidth);
|
||||
double newWidth = -1;
|
||||
|
||||
if (newWidth < 0)
|
||||
if (value < 0 || double.IsNaN(value))
|
||||
{
|
||||
newWidth = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWidth = value;
|
||||
}
|
||||
|
||||
if (_width != value)
|
||||
if (_width != newWidth)
|
||||
{
|
||||
_width = newWidth;
|
||||
OnPropertyChanged();
|
||||
@@ -167,15 +170,18 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
set
|
||||
{
|
||||
int newHeight = -1;
|
||||
int.TryParse(value + string.Empty, out newHeight);
|
||||
double newHeight = -1;
|
||||
|
||||
if (newHeight < 0)
|
||||
if (value < 0 || double.IsNaN(value))
|
||||
{
|
||||
newHeight = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
newHeight = value;
|
||||
}
|
||||
|
||||
if (_height != value)
|
||||
if (_height != newHeight)
|
||||
{
|
||||
_height = newHeight;
|
||||
OnPropertyChanged();
|
||||
|
||||
Reference in New Issue
Block a user