mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
added null value handle for image resizer size input (#4721)
* addle null value handle for image resizer size input * check for negative withd and height * check for negative withd and height * Update ImageSize.cs Co-authored-by: Lavius Motileng <laviusntk>
This commit is contained in:
@@ -144,9 +144,17 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
set
|
||||
{
|
||||
int newWidth = -1;
|
||||
int.TryParse(value + string.Empty, out newWidth);
|
||||
|
||||
if (newWidth < 0)
|
||||
{
|
||||
newWidth = 0;
|
||||
}
|
||||
|
||||
if (_width != value)
|
||||
{
|
||||
_width = value;
|
||||
_width = newWidth;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -162,9 +170,17 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
|
||||
set
|
||||
{
|
||||
int newHeight = -1;
|
||||
int.TryParse(value + string.Empty, out newHeight);
|
||||
|
||||
if (newHeight < 0)
|
||||
{
|
||||
newHeight = 0;
|
||||
}
|
||||
|
||||
if (_height != value)
|
||||
{
|
||||
_height = value;
|
||||
_height = newHeight;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user