@mlightcad/mtext-renderer 0.8.3 → 0.8.5

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.js CHANGED
@@ -23991,7 +23991,7 @@ class _l {
23991
23991
  const s = this.getCharShape(e[i]);
23992
23992
  s ? this.currentHorizontalAlignment == Se.DISTRIBUTED ? a += s.width * this.currentWidthFactor : a += s.width * this.currentWordSpace * this.currentWidthFactor : a += this._currentContext.blankWidth;
23993
23993
  }
23994
- this.hOffset + a > (this.maxLineWidth || 1 / 0) && this.startNewLine();
23994
+ this.hOffset + a > (this.maxLineWidth || 1 / 0) && (this._vOffset <= 0 && this._currentLineObjects.length <= 0 || this.startNewLine());
23995
23995
  for (let i = 0; i < e.length; i++)
23996
23996
  this.processChar(e[i], r, n);
23997
23997
  }
@@ -24625,10 +24625,10 @@ class Pl {
24625
24625
  1,
24626
24626
  navigator.hardwareConcurrency ? Math.min(4, navigator.hardwareConcurrency) : 2
24627
24627
  ), this.defaultStyleManager = new Ii();
24628
- const r = e.workerUrl ?? "./mtext-renderer-worker.js";
24628
+ const r = e.workerUrl ?? "./assets/mtext-renderer-worker.js";
24629
24629
  this.timeOut = e.timeOut ?? 12e4;
24630
24630
  for (let n = 0; n < this.poolSize; n++) {
24631
- const a = new Worker(new URL(r, import.meta.url), {
24631
+ const a = new Worker(r, {
24632
24632
  type: "module"
24633
24633
  });
24634
24634
  this.attachWorkerHandlers(a, n), this.workers.push(a), this.inFlightPerWorker.push(0);