mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
checking for NaN, not just zero (#12058)
This commit is contained in:
@@ -84,7 +84,7 @@ namespace ImageResizer.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bool HasAuto
|
public bool HasAuto
|
||||||
=> Width == 0 || Height == 0;
|
=> Width == 0 || Height == 0 || double.IsNaN(Width) || double.IsNaN(Height);
|
||||||
|
|
||||||
[JsonProperty(PropertyName = "unit")]
|
[JsonProperty(PropertyName = "unit")]
|
||||||
public ResizeUnit Unit
|
public ResizeUnit Unit
|
||||||
@@ -125,7 +125,7 @@ namespace ImageResizer.Models
|
|||||||
|
|
||||||
private double ConvertToPixels(double value, ResizeUnit unit, int originalValue, double dpi)
|
private double ConvertToPixels(double value, ResizeUnit unit, int originalValue, double dpi)
|
||||||
{
|
{
|
||||||
if (value == 0)
|
if (value == 0 || double.IsNaN(value))
|
||||||
{
|
{
|
||||||
if (Fit == ResizeFit.Fit)
|
if (Fit == ResizeFit.Fit)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user