@leafer-draw/worker 1.9.10 → 1.9.12

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.
@@ -3840,7 +3840,12 @@ class TaskProcessor {
3840
3840
  runTask() {
3841
3841
  const task = this.list[this.index];
3842
3842
  if (!task) {
3843
- this.nextTask();
3843
+ this.timer = setTimeout(() => this.nextTask());
3844
+ return;
3845
+ }
3846
+ if (task.isCancel) {
3847
+ this.index++;
3848
+ this.runTask();
3844
3849
  return;
3845
3850
  }
3846
3851
  task.run().then(() => {
@@ -3871,16 +3876,15 @@ class TaskProcessor {
3871
3876
  }
3872
3877
  setParallelList() {
3873
3878
  let task;
3879
+ const {config: config, list: list, index: index} = this;
3874
3880
  this.parallelList = [];
3875
3881
  this.parallelSuccessNumber = 0;
3876
- let end = this.index + this.config.parallel;
3877
- if (end > this.list.length) end = this.list.length;
3878
- for (let i = this.index; i < end; i++) {
3879
- task = this.list[i];
3880
- if (task.parallel) {
3881
- this.parallelList.push(task);
3882
- } else {
3883
- break;
3882
+ let end = index + config.parallel;
3883
+ if (end > list.length) end = list.length;
3884
+ if (config.parallel > 1) {
3885
+ for (let i = index; i < end; i++) {
3886
+ task = list[i];
3887
+ if (task.parallel) this.parallelList.push(task); else break;
3884
3888
  }
3885
3889
  }
3886
3890
  }
@@ -6815,7 +6819,7 @@ class LeafLevelList {
6815
6819
  }
6816
6820
  }
6817
6821
 
6818
- const version = "1.9.10";
6822
+ const version = "1.9.12";
6819
6823
 
6820
6824
  class LeaferCanvas extends LeaferCanvasBase {
6821
6825
  get allowBackgroundColor() {
@@ -10344,11 +10348,11 @@ function getShadowRenderSpread(_ui, shadow) {
10344
10348
 
10345
10349
  function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
10346
10350
  if (shadow.spread) {
10347
- const spreadScale = 1 + shadow.spread * 2 / ui.__layout.strokeBounds.width * otherScale * (isInnerShaodw ? -1 : 1);
10351
+ const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), {width: width, height: height} = ui.__layout.strokeBounds;
10348
10352
  tempMatrix.set().scaleOfOuter({
10349
10353
  x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
10350
10354
  y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
10351
- }, spreadScale);
10355
+ }, 1 + spread / width, 1 + spread / height);
10352
10356
  return tempMatrix;
10353
10357
  }
10354
10358
  return undefined;