Browse Source

fix usage of GetPixelRowSpan().

pull/299/head
Scott Williams 9 years ago
parent
commit
ff3e372e26
  1. 2
      src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs
  2. 2
      src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs

2
src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs

@ -78,7 +78,7 @@ namespace SixLabors.ImageSharp.Drawing.Brushes.Processors
overlay[i] = this[x + i, y]; overlay[i] = this[x + i, y];
} }
Span<TPixel> destinationRow = this.Target.GetPixelRowSpan(x).Slice(y, scanline.Length); Span<TPixel> destinationRow = this.Target.GetPixelRowSpan(y).Slice(x, scanline.Length);
this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer); this.Blender.Blend(destinationRow, destinationRow, overlay, amountBuffer);
} }
} }

2
src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs

@ -52,7 +52,7 @@ namespace SixLabors.ImageSharp.Processing.Processors
source.Configuration.ParallelOptions, source.Configuration.ParallelOptions,
y => y =>
{ {
Span<TPixel> sourceRow = source.GetPixelRowSpan(minX).Slice(y); Span<TPixel> sourceRow = source.GetPixelRowSpan(y).Slice(minX);
Span<TPixel> targetRow = targetPixels.GetRowSpan(y - minY); Span<TPixel> targetRow = targetPixels.GetRowSpan(y - minY);
SpanHelper.Copy(sourceRow, targetRow, maxX - minX); SpanHelper.Copy(sourceRow, targetRow, maxX - minX);
}); });

Loading…
Cancel
Save