ag-psd 17.0.0 → 17.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v17.0.1
4
+ - Fixed incorrect reading and writing of slice bounds
5
+ - Fixed missing bounds and boundingBox fields on `layer.text`
6
+
3
7
  ## v17.0.0
4
8
  - Added `effectsOpen` field to layers
5
9
  - Added support for basic set of smart layer filters
@@ -74,6 +74,10 @@ addHandler('TySh', hasKey('text'), function (reader, target, leftBytes) {
74
74
  rotate: descriptor_1.Ornt.decode(warp.warpRotate),
75
75
  },
76
76
  };
77
+ if (text.bounds)
78
+ target.text.bounds = (0, descriptor_1.descBoundsToBounds)(text.bounds);
79
+ if (text.boundingBox)
80
+ target.text.boundingBox = (0, descriptor_1.descBoundsToBounds)(text.boundingBox);
77
81
  if (text.EngineData) {
78
82
  var engineData = (0, engineData_1.parseEngineData)(text.EngineData);
79
83
  var textData = (0, text_1.decodeEngineData)(engineData);
@@ -91,20 +95,13 @@ addHandler('TySh', hasKey('text'), function (reader, target, leftBytes) {
91
95
  var text = target.text;
92
96
  var warp = text.warp || {};
93
97
  var transform = text.transform || [1, 0, 0, 1, 0, 0];
94
- var textDescriptor = {
95
- 'Txt ': (text.text || '').replace(/\r?\n/g, '\r'),
96
- textGridding: descriptor_1.textGridding.encode(text.gridding),
97
- Ornt: descriptor_1.Ornt.encode(text.orientation),
98
- AntA: descriptor_1.Annt.encode(text.antiAlias),
99
- TextIndex: text.index || 0,
100
- EngineData: (0, engineData_1.serializeEngineData)((0, text_1.encodeEngineData)(text)),
101
- };
98
+ var textDescriptor = __assign(__assign(__assign({ 'Txt ': (text.text || '').replace(/\r?\n/g, '\r'), textGridding: descriptor_1.textGridding.encode(text.gridding), Ornt: descriptor_1.Ornt.encode(text.orientation), AntA: descriptor_1.Annt.encode(text.antiAlias) }, (text.bounds ? { bounds: (0, descriptor_1.boundsToDescBounds)(text.bounds) } : {})), (text.boundingBox ? { boundingBox: (0, descriptor_1.boundsToDescBounds)(text.boundingBox) } : {})), { TextIndex: text.index || 0, EngineData: (0, engineData_1.serializeEngineData)((0, text_1.encodeEngineData)(text)) });
102
99
  (0, psdWriter_1.writeInt16)(writer, 1); // version
103
100
  for (var i = 0; i < 6; i++) {
104
101
  (0, psdWriter_1.writeFloat64)(writer, transform[i]);
105
102
  }
106
103
  (0, psdWriter_1.writeInt16)(writer, 50); // text version
107
- (0, descriptor_1.writeVersionAndDescriptor)(writer, '', 'TxLr', textDescriptor);
104
+ (0, descriptor_1.writeVersionAndDescriptor)(writer, '', 'TxLr', textDescriptor, 'text');
108
105
  (0, psdWriter_1.writeInt16)(writer, 1); // warp version
109
106
  (0, descriptor_1.writeVersionAndDescriptor)(writer, '', 'warp', encodeWarp(warp));
110
107
  (0, psdWriter_1.writeFloat32)(writer, text.left);