ag-psd 20.2.3 → 21.0.0

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
@@ -448,7 +448,7 @@ export interface BezierKnot {
448
448
  export type BooleanOperation = 'exclude' | 'combine' | 'subtract' | 'intersect';
449
449
  export interface BezierPath {
450
450
  open: boolean;
451
- operation: BooleanOperation;
451
+ operation?: BooleanOperation;
452
452
  knots: BezierKnot[];
453
453
  fillRule: 'even-odd' | 'non-zero';
454
454
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-psd",
3
- "version": "20.2.3",
3
+ "version": "21.0.0",
4
4
  "description": "Library for reading and writing PSD files",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist-es/index.js",
@@ -244,13 +244,12 @@ export function readVectorMask(reader: PsdReader, vectorMask: LayerVectorMask, w
244
244
  const boolOp = readInt16(reader);
245
245
  const flags = readUint16(reader); // bit 1 always 1 ?
246
246
  skipBytes(reader, 18);
247
- // TODO: 'combine' here might be wrong
248
247
  path = {
249
248
  open: selector === 3,
250
- operation: boolOp === -1 ? 'combine' : booleanOperations[boolOp],
251
249
  knots: [],
252
250
  fillRule: flags === 2 ? 'non-zero' : 'even-odd',
253
251
  };
252
+ if (boolOp !== -1) path.operation = booleanOperations[boolOp];
254
253
  paths.push(path);
255
254
  break;
256
255
  }
@@ -339,7 +338,7 @@ addHandler(
339
338
  for (const path of vectorMask.paths) {
340
339
  writeUint16(writer, path.open ? 3 : 0);
341
340
  writeUint16(writer, path.knots.length);
342
- writeUint16(writer, Math.abs(booleanOperations.indexOf(path.operation))); // default to 1 if not found
341
+ writeUint16(writer, path.operation ? booleanOperations.indexOf(path.operation) : -1); // -1 for undefined
343
342
  writeUint16(writer, path.fillRule === 'non-zero' ? 2 : 1);
344
343
  writeZeros(writer, 18); // TODO: these are sometimes non-zero
345
344
 
package/src/psd.ts CHANGED
@@ -446,7 +446,7 @@ export type BooleanOperation = 'exclude' | 'combine' | 'subtract' | 'intersect';
446
446
 
447
447
  export interface BezierPath {
448
448
  open: boolean;
449
- operation: BooleanOperation;
449
+ operation?: BooleanOperation;
450
450
  knots: BezierKnot[];
451
451
  fillRule: 'even-odd' | 'non-zero';
452
452
  }