Skip to content

Commit

Permalink
Update TaskParameter.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-luberda committed May 3, 2019
1 parent 22927e4 commit fe6b907
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/FFImageLoading.Common/Work/TaskParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ public TaskParameter ErrorPlaceholder(string filepath, ImageSource source = Imag
public TaskParameter DownSample(int width = 0, int height = 0, bool? allowUpscale = null)
{
DownSampleUseDipUnits = false;

width = Math.Max(0, width);
height = Math.Max(0, height);
DownSampleSize = Tuple.Create(width, width > 0 ? 0 : height);
AllowUpscale = allowUpscale;

Expand All @@ -291,7 +292,9 @@ public TaskParameter DownSample(int width = 0, int height = 0, bool? allowUpscal
public TaskParameter DownSampleInDip(int width = 0, int height = 0, bool? allowUpscale = null)
{
DownSampleUseDipUnits = true;
DownSampleSize = Tuple.Create(width, width > 0 ? 0 : height);
width = Math.Max(0, width);
height = Math.Max(0, height);
DownSampleSize = Tuple.Create(width, width > 0 ? 0 : height);
AllowUpscale = allowUpscale;

return this;
Expand Down

0 comments on commit fe6b907

Please sign in to comment.