mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
checking for NaN, not just zero (#12058)
This commit is contained in:
parent
9c248cdcd2
commit
03eb9c3f5c
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user