File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/ImageSharp/Processing/Processors/Transforms/Resize Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ private void CalculateFirstPassValues(RowInterval calculationInterval)
172172
173173 int left = this . targetWorkingRect . Left ;
174174 int right = this . targetWorkingRect . Right ;
175- int targetOriginX = left > this . targetOrigin . X ? left - this . targetOrigin . X : this . targetOrigin . X ;
175+ int targetOriginX = this . targetOrigin . X ;
176176 for ( int y = calculationInterval . Min ; y < calculationInterval . Max ; y ++ )
177177 {
178178 Span < TPixel > sourceRow = this . source . DangerousGetRowSpan ( y ) ;
@@ -187,13 +187,13 @@ private void CalculateFirstPassValues(RowInterval calculationInterval)
187187 // Span<Vector4> firstPassSpan = transposedFirstPassBufferSpan.Slice(y - this.currentWindow.Min);
188188 ref Vector4 firstPassBaseRef = ref transposedFirstPassBufferSpan [ y - this . currentWindow . Min ] ;
189189
190- for ( nint x = 0 ; x < ( right - left ) ; x ++ )
190+ for ( nint x = left , z = 0 ; x < right ; x ++ , z ++ )
191191 {
192192 ResizeKernel kernel = this . horizontalKernelMap . GetKernel ( x - targetOriginX ) ;
193193
194194 // optimization for:
195195 // firstPassSpan[x * this.workerHeight] = kernel.Convolve(tempRowSpan);
196- Unsafe . Add ( ref firstPassBaseRef , x * this . workerHeight ) = kernel. Convolve ( tempRowSpan ) ;
196+ Unsafe . Add ( ref firstPassBaseRef , z * this . workerHeight ) = kernel. Convolve ( tempRowSpan ) ;
197197 }
198198 }
199199 }
You can’t perform that action at this time.
0 commit comments