com.wallstop-studios.unity-helpers 2.0.0-rc74.6 → 2.0.0-rc74.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -363,10 +363,10 @@
|
|
|
363
363
|
}
|
|
364
364
|
else
|
|
365
365
|
{
|
|
366
|
-
minX
|
|
367
|
-
minY
|
|
368
|
-
maxX
|
|
369
|
-
maxY
|
|
366
|
+
minX -= _leftPadding;
|
|
367
|
+
minY -= _bottomPadding;
|
|
368
|
+
maxX += _rightPadding;
|
|
369
|
+
maxY += _topPadding;
|
|
370
370
|
cropWidth = maxX - minX + 1;
|
|
371
371
|
cropHeight = maxY - minY + 1;
|
|
372
372
|
}
|
|
@@ -388,7 +388,17 @@
|
|
|
388
388
|
int destYOffset = y * cropWidth;
|
|
389
389
|
for (int x = 0; x < cropWidth; ++x)
|
|
390
390
|
{
|
|
391
|
-
|
|
391
|
+
int sourceIndex = sourceYOffset + x + minX;
|
|
392
|
+
Color32 sourcePixel;
|
|
393
|
+
if (sourceIndex < 0 || pixels.Length <= sourceIndex)
|
|
394
|
+
{
|
|
395
|
+
sourcePixel = Color.clear;
|
|
396
|
+
}
|
|
397
|
+
else
|
|
398
|
+
{
|
|
399
|
+
sourcePixel = pixels[sourceIndex];
|
|
400
|
+
}
|
|
401
|
+
croppedPixels[destYOffset + x] = sourcePixel;
|
|
392
402
|
}
|
|
393
403
|
}
|
|
394
404
|
);
|
package/package.json
CHANGED