lbrnts 0.0.2 → 0.0.3

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/index.d.ts CHANGED
@@ -205,13 +205,13 @@ type Mat = [
205
205
  declare abstract class ShapeBase extends LightBurnBaseElement {
206
206
  cutIndex?: number;
207
207
  locked?: boolean;
208
- xform?: Mat;
208
+ xform: Mat;
209
209
  protected getShapeXmlAttributes(): Record<string, string | number | boolean | undefined>;
210
210
  getChildren(): LightBurnBaseElement[];
211
211
  static readCommon(node: XmlJsonElement): {
212
212
  cutIndex?: number;
213
213
  locked?: boolean;
214
- xform?: Mat;
214
+ xform: Mat;
215
215
  };
216
216
  }
217
217
 
package/dist/index.js CHANGED
@@ -637,7 +637,8 @@ LightBurnBaseElement.register("Thumbnail", Thumbnail);
637
637
  var ShapeBase = class extends LightBurnBaseElement {
638
638
  cutIndex;
639
639
  locked;
640
- xform;
640
+ xform = [1, 0, 0, 1, 0, 0];
641
+ // Default identity matrix
641
642
  getShapeXmlAttributes() {
642
643
  return {
643
644
  CutIndex: this.cutIndex,
@@ -646,14 +647,15 @@ var ShapeBase = class extends LightBurnBaseElement {
646
647
  }
647
648
  getChildren() {
648
649
  const children = [];
649
- if (this.xform) {
650
- const xformElement = new XFormElement(this.xform);
651
- children.push(xformElement);
652
- }
650
+ const xformElement = new XFormElement(this.xform);
651
+ children.push(xformElement);
653
652
  return children;
654
653
  }
655
654
  static readCommon(node) {
656
- const common = {};
655
+ const common = {
656
+ xform: [1, 0, 0, 1, 0, 0]
657
+ // Default identity matrix
658
+ };
657
659
  if (node.$) {
658
660
  if (node.$.CutIndex !== void 0) {
659
661
  common.cutIndex = num(node.$.CutIndex, void 0);
@@ -1040,7 +1042,8 @@ var ShapeGroup = class _ShapeGroup extends ShapeBase {
1040
1042
  return group;
1041
1043
  }
1042
1044
  getChildren() {
1043
- return this.children;
1045
+ const baseChildren = super.getChildren();
1046
+ return [...baseChildren, ...this.children];
1044
1047
  }
1045
1048
  };
1046
1049
  LightBurnBaseElement.register("Shape.Group", ShapeGroup);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lbrnts",
3
3
  "main": "dist/index.js",
4
4
  "type": "module",
5
- "version": "0.0.2",
5
+ "version": "0.0.3",
6
6
  "files": [
7
7
  "dist"
8
8
  ],