ag-psd 17.0.6 → 18.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/dist-es/psd.d.ts CHANGED
@@ -444,6 +444,7 @@ export interface BezierPath {
444
444
  open: boolean;
445
445
  operation: BooleanOperation;
446
446
  knots: BezierKnot[];
447
+ fillRule: 'even-odd' | 'non-zero';
447
448
  }
448
449
  export interface ExtraGradientInfo {
449
450
  style?: GradientStyle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-psd",
3
- "version": "17.0.6",
3
+ "version": "18.0.1",
4
4
  "description": "Library for reading and writing PSD files",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist-es/index.js",
@@ -266,10 +266,15 @@ export function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, w
266
266
  case 3: { // Open subpath length record
267
267
  readUint16(reader); // count
268
268
  const boolOp = readInt16(reader);
269
- readUint16(reader); // always 1 ?
269
+ const flags = readUint16(reader); // bit 1 always 1 ?
270
270
  skipBytes(reader, 18);
271
271
  // TODO: 'combine' here might be wrong
272
- path = { open: selector === 3, operation: boolOp === -1 ? 'combine' : booleanOperations[boolOp], knots: [] };
272
+ path = {
273
+ open: selector === 3,
274
+ operation: boolOp === -1 ? 'combine' : booleanOperations[boolOp],
275
+ knots: [],
276
+ fillRule: flags === 2 ? 'non-zero' : 'even-odd',
277
+ };
273
278
  paths.push(path);
274
279
  break;
275
280
  }
@@ -359,7 +364,7 @@ addHandler(
359
364
  writeUint16(writer, path.open ? 3 : 0);
360
365
  writeUint16(writer, path.knots.length);
361
366
  writeUint16(writer, Math.abs(booleanOperations.indexOf(path.operation))); // default to 1 if not found
362
- writeUint16(writer, 1);
367
+ writeUint16(writer, path.fillRule === 'non-zero' ? 2 : 1);
363
368
  writeZeros(writer, 18); // TODO: these are sometimes non-zero
364
369
 
365
370
  const linkedKnot = path.open ? 4 : 1;
package/src/psd.ts CHANGED
@@ -441,6 +441,7 @@ export interface BezierPath {
441
441
  open: boolean;
442
442
  operation: BooleanOperation;
443
443
  knots: BezierKnot[];
444
+ fillRule: 'even-odd' | 'non-zero';
444
445
  }
445
446
 
446
447
  export interface ExtraGradientInfo {