mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +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
|
set
|
||||||
{
|
{
|
||||||
int newWidth = -1;
|
double newWidth = -1;
|
||||||
int.TryParse(value + string.Empty, out newWidth);
|
|
||||||
|
|
||||||
if (newWidth < 0)
|
if (value < 0 || double.IsNaN(value))
|
||||||
{
|
{
|
||||||
newWidth = 0;
|
newWidth = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newWidth = value;
|
||||||
|
}
|
||||||
|
|
||||||
if (_width != value)
|
if (_width != newWidth)
|
||||||
{
|
{
|
||||||
_width = newWidth;
|
_width = newWidth;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
@@ -167,15 +170,18 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
int newHeight = -1;
|
double newHeight = -1;
|
||||||
int.TryParse(value + string.Empty, out newHeight);
|
|
||||||
|
|
||||||
if (newHeight < 0)
|
if (value < 0 || double.IsNaN(value))
|
||||||
{
|
{
|
||||||
newHeight = 0;
|
newHeight = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newHeight = value;
|
||||||
|
}
|
||||||
|
|
||||||
if (_height != value)
|
if (_height != newHeight)
|
||||||
{
|
{
|
||||||
_height = newHeight;
|
_height = newHeight;
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user