Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [4.0.2] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1266986)
- Fixed Sprite Editor Window doesn't show the Sprite when the Inspector is locked and the Sprite is not selected in the Project window
  • Loading branch information
Unity Technologies committed Aug 31, 2020
1 parent 762a82e commit a5f6b30
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## [4.0.2] - 2020-08-31
### Fixed
- Fixed importing files with vector layers generates textures incorrectly (case 1266986)
- Fixed Sprite Editor Window doesn't show the Sprite when the Inspector is locked and the Sprite is not selected in the Project window

## [4.0.1] - 2020-07-07
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Editor/PSDImporterEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,15 +633,15 @@ void DoSpriteInspector()
dialogText, s_Styles.applyButtonLabel.text, s_Styles.revertButtonLabel.text))
{
ApplyAndImport();
InternalEditorBridge.ShowSpriteEditorWindow();
InternalEditorBridge.ShowSpriteEditorWindow(this.assetTarget);

// We reimported the asset which destroyed the editor, so we can't keep running the UI here.
GUIUtility.ExitGUI();
}
}
else
{
InternalEditorBridge.ShowSpriteEditorWindow();
InternalEditorBridge.ShowSpriteEditorWindow(this.assetTarget);
}
}
GUILayout.EndHorizontal();
Expand Down
7 changes: 4 additions & 3 deletions Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,24 +513,25 @@ 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++;
}
}
}
}
// Apply both masks in one pass, to minimize rounding error
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
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.unity.2d.psdimporter",
"version": "4.0.1",
"version": "4.0.2",
"unity": "2020.2",
"unityRelease": "0a19",
"displayName": "2D PSD Importer",
Expand All @@ -12,19 +12,19 @@
],
"category": "2D",
"dependencies": {
"com.unity.2d.common": "4.0.1",
"com.unity.2d.animation": "5.0.1",
"com.unity.2d.common": "4.0.2",
"com.unity.2d.animation": "5.0.2",
"com.unity.2d.sprite": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.psdimporter.tests": "4.0.1"
"com.unity.2d.psdimporter.tests": "4.0.2"
},
"upmCi": {
"footprint": "8f06a9aae8646933a40d67cc3ac738f21194b732"
"footprint": "37d303850b7c31729b17df490e53843ba578aada"
},
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "7d7470f4ca0ea8353d4c9640b3b6ae9d1ebd9c1d"
"revision": "4e96f68a7587d87b4fee15d6f88a5d86c2afa9aa"
}
}

0 comments on commit a5f6b30

Please sign in to comment.