mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
image resizer and settings percentage unit (#8674)
This commit is contained in:
committed by
GitHub
parent
34ff670e5b
commit
11bdbaa07f
@@ -52,7 +52,15 @@ namespace ImageResizer.Models
|
||||
public ResizeFit Fit
|
||||
{
|
||||
get => _fit;
|
||||
set => Set(ref _fit, value);
|
||||
set
|
||||
{
|
||||
var previousFit = _fit;
|
||||
Set(ref _fit, value);
|
||||
if (!Equals(previousFit, value))
|
||||
{
|
||||
UpdateShowHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(PropertyName = "width")]
|
||||
@@ -112,7 +120,7 @@ namespace ImageResizer.Models
|
||||
|
||||
private void UpdateShowHeight()
|
||||
{
|
||||
ShowHeight = Unit != ResizeUnit.Percent;
|
||||
ShowHeight = Fit == ResizeFit.Stretch || Unit != ResizeUnit.Percent;
|
||||
}
|
||||
|
||||
private double ConvertToPixels(double value, ResizeUnit unit, int originalValue, double dpi)
|
||||
|
||||
Reference in New Issue
Block a user