pts 0.12.1 → 0.12.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.mts CHANGED
@@ -621,7 +621,7 @@ declare class CanvasForm extends VisualForm {
621
621
  protected _ctx: CanvasRenderingContext2D;
622
622
  protected _estimateTextWidth: (string: any) => number;
623
623
  protected _style: DefaultFormStyle;
624
- constructor(space?: CanvasSpace | CanvasRenderingContext2D);
624
+ constructor(space?: CanvasSpace | CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D);
625
625
  get space(): CanvasSpace;
626
626
  get ctx(): PtsCanvasRenderingContext2D;
627
627
  useOffscreen(off?: boolean, clear?: boolean | string): this;
package/dist/index.d.ts CHANGED
@@ -621,7 +621,7 @@ declare class CanvasForm extends VisualForm {
621
621
  protected _ctx: CanvasRenderingContext2D;
622
622
  protected _estimateTextWidth: (string: any) => number;
623
623
  protected _style: DefaultFormStyle;
624
- constructor(space?: CanvasSpace | CanvasRenderingContext2D);
624
+ constructor(space?: CanvasSpace | CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D);
625
625
  get space(): CanvasSpace;
626
626
  get ctx(): PtsCanvasRenderingContext2D;
627
627
  useOffscreen(off?: boolean, clear?: boolean | string): this;
package/dist/index.js CHANGED
@@ -6197,13 +6197,13 @@ var CanvasForm = class _CanvasForm extends VisualForm {
6197
6197
  this._ctx.font = this._font.value;
6198
6198
  this._ready = true;
6199
6199
  };
6200
- if (space instanceof CanvasRenderingContext2D) {
6201
- _setup(space);
6202
- } else {
6200
+ if (space instanceof CanvasSpace2) {
6203
6201
  this._space = space;
6204
6202
  this._space.add({ start: () => {
6205
6203
  _setup(this._space.ctx);
6206
6204
  } });
6205
+ } else {
6206
+ _setup(space);
6207
6207
  }
6208
6208
  }
6209
6209
  /**
package/dist/index.mjs CHANGED
@@ -6129,13 +6129,13 @@ var CanvasForm = class _CanvasForm extends VisualForm {
6129
6129
  this._ctx.font = this._font.value;
6130
6130
  this._ready = true;
6131
6131
  };
6132
- if (space instanceof CanvasRenderingContext2D) {
6133
- _setup(space);
6134
- } else {
6132
+ if (space instanceof CanvasSpace2) {
6135
6133
  this._space = space;
6136
6134
  this._space.add({ start: () => {
6137
6135
  _setup(this._space.ctx);
6138
6136
  } });
6137
+ } else {
6138
+ _setup(space);
6139
6139
  }
6140
6140
  }
6141
6141
  /**
package/dist/pts.js CHANGED
@@ -6229,13 +6229,13 @@ See https://github.com/williamngan/pts for details. */
6229
6229
  this._ctx.font = this._font.value;
6230
6230
  this._ready = true;
6231
6231
  };
6232
- if (space instanceof CanvasRenderingContext2D) {
6233
- _setup(space);
6234
- } else {
6232
+ if (space instanceof CanvasSpace2) {
6235
6233
  this._space = space;
6236
6234
  this._space.add({ start: () => {
6237
6235
  _setup(this._space.ctx);
6238
6236
  } });
6237
+ } else {
6238
+ _setup(space);
6239
6239
  }
6240
6240
  }
6241
6241
  /**