com.wallstop-studios.unity-helpers 2.0.0-rc73.12 → 2.0.0-rc73.13
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.
- package/Editor/SpriteCropper.cs +7 -6
- package/package.json +2 -1
package/Editor/SpriteCropper.cs
CHANGED
|
@@ -341,19 +341,20 @@
|
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
|
|
344
|
-
if (!hasVisible)
|
|
345
|
-
{
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
344
|
int cropWidth = maxX - minX + 1;
|
|
350
345
|
int cropHeight = maxY - minY + 1;
|
|
351
346
|
|
|
352
|
-
if (_onlyNecessary && cropWidth == width && cropHeight == height)
|
|
347
|
+
if (_onlyNecessary && (!hasVisible || (cropWidth == width && cropHeight == height)))
|
|
353
348
|
{
|
|
354
349
|
return null;
|
|
355
350
|
}
|
|
356
351
|
|
|
352
|
+
if (!hasVisible)
|
|
353
|
+
{
|
|
354
|
+
cropWidth = 1;
|
|
355
|
+
cropHeight = 1;
|
|
356
|
+
}
|
|
357
|
+
|
|
357
358
|
Texture2D cropped = new(cropWidth, cropHeight, TextureFormat.RGBA32, false);
|
|
358
359
|
Color32[] croppedPixels = new Color32[cropWidth * cropHeight];
|
|
359
360
|
|
package/package.json
CHANGED