Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [3.1.6] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1271228)
  • Loading branch information
Unity Technologies committed Aug 31, 2020
1 parent 208d616 commit 560e8d2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [3.1.6] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1271228)

## [3.1.5] - 2020-07-19
### Fixed
- Fixed ArgumentException when applying Sprite Import settings with mosaic property unchecked (case 1253198)
Expand Down
5 changes: 3 additions & 2 deletions Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,12 @@ private void ApplyPDNMask(int dstStart, int dstStops)
var maskAlpha = (0 == Data.HasLayerAlphaMask) ? Data.UserAlphaMask : Data.LayerAlphaMask;
var maskStart = 0;
{
var c = Data.DecodedImage[dstStart];
while (dstStart < dstStops)
{
var c = Data.DecodedImage[dstStart];
c.a = (byte)(Data.DecodedImage[dstStart].a * maskAlpha[maskStart] / 255);
Data.DecodedImage[dstStart] = c;

dstStart++;
maskStart++;
}
Expand All @@ -527,10 +528,10 @@ private void ApplyPDNMask(int dstStart, int dstStops)
else
{
var maskStart = 0;
var c = Data.DecodedImage[dstStart];
{
while (dstStart < dstStops)
{
var c = Data.DecodedImage[dstStart];
var alphaFactor = (Data.LayerAlphaMask[maskStart]) * (Data.UserAlphaMask[maskStart]);
c.a = (byte)(Data.DecodedImage[dstStart].a * alphaFactor / 65025);
Data.DecodedImage[dstStart] = c;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.unity.2d.psdimporter",
"version": "3.1.5",
"version": "3.1.6",
"unity": "2020.1",
"unityRelease": "0a10",
"displayName": "2D PSD Importer",
Expand All @@ -13,18 +13,18 @@
"category": "2D",
"dependencies": {
"com.unity.2d.common": "3.0.1",
"com.unity.2d.animation": "4.2.5",
"com.unity.2d.animation": "4.2.6",
"com.unity.2d.sprite": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.psdimporter.tests": "3.1.5"
"com.unity.2d.psdimporter.tests": "3.1.6"
},
"upmCi": {
"footprint": "3dbe4feeab5b289ef36f5bf8e3a5865b386f1f3d"
"footprint": "b0a8c4b33787760ad8064e9cfaad95343ba9ae93"
},
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "770e07a3b7a9107798c367cae274d1d3418c4ede"
"revision": "4e323a9f3edf4c6dc06ab4d1582e12f07cb54189"
}
}

0 comments on commit 560e8d2

Please sign in to comment.