Browse Source

improve comments again

af/merge-core
Anton Firszov 8 years ago
parent
commit
5cbe335d95
  1. 7
      src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.cs

7
src/ImageSharp/Processing/Processors/Transforms/Resize/ResizeKernelMap.cs

@ -104,9 +104,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
double ratio = (double)sourceSize / destinationSize;
double scale = ratio;
if (scale < 1F)
if (scale < 1)
{
scale = 1F;
scale = 1;
}
int radius = (int)TolerantMath.Ceiling(scale * sampler.Radius);
@ -126,7 +126,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms
// however, it's just simpler to calculate them separately.
int cornerInterval = (int)TolerantMath.Ceiling(firstNonNegativeLeftVal);
// If firstNonNegativeLeftVal was an integral value, we don't need Ceiling:
// If firstNonNegativeLeftVal was an integral value, we need firstNonNegativeLeftVal+1
// instead of Ceiling:
if (TolerantMath.AreEqual(firstNonNegativeLeftVal, cornerInterval))
{
cornerInterval++;

Loading…
Cancel
Save