Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [2.1.6] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1271229)
  • Loading branch information
Unity Technologies committed Aug 31, 2020
1 parent 12a562e commit caa2a5d
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,4 +1,8 @@
# Changelog
## [2.1.6] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1271229)

## [2.1.5] - 2020-07-23
### Fixed
- Fixed ArgumentException when 2D Game Kit is imported for the first time (case 1259290)
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": "2.1.5",
"version": "2.1.6",
"unity": "2019.4",
"unityRelease": "0b11",
"displayName": "2D PSD Importer",
Expand All @@ -13,18 +13,18 @@
"category": "2D",
"dependencies": {
"com.unity.2d.common": "2.0.2",
"com.unity.2d.animation": "3.2.4",
"com.unity.2d.animation": "3.2.5",
"com.unity.2d.sprite": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.psdimporter.tests": "2.1.5"
"com.unity.2d.psdimporter.tests": "2.1.6"
},
"upmCi": {
"footprint": "bbe4314e8b66614e13aedede739cf98f73ebc93c"
"footprint": "b88ca68fb8d7f51d860b71092366cdb92da664af"
},
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "3dd60315414ba10db42e8629a9a74d37929aca1b"
"revision": "29ea650b8c577781bb2fae453ff381ad0aae8347"
}
}

0 comments on commit caa2a5d

Please sign in to comment.