leafer-draw 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
  const debug$4 = Debug.get("LeaferCanvas");
6821
6825
 
@@ -10550,11 +10554,11 @@ function getShadowRenderSpread(_ui, shadow) {
10550
10554
 
10551
10555
  function getShadowTransform(ui, canvas, _shape, shadow, outBounds, otherScale, isInnerShaodw) {
10552
10556
  if (shadow.spread) {
10553
- const spreadScale = 1 + shadow.spread * 2 / ui.__layout.strokeBounds.width * otherScale * (isInnerShaodw ? -1 : 1);
10557
+ const spread = shadow.spread * 2 * otherScale * (isInnerShaodw ? -1 : 1), {width: width, height: height} = ui.__layout.strokeBounds;
10554
10558
  tempMatrix.set().scaleOfOuter({
10555
10559
  x: (outBounds.x + outBounds.width / 2) * canvas.pixelRatio,
10556
10560
  y: (outBounds.y + outBounds.height / 2) * canvas.pixelRatio
10557
- }, spreadScale);
10561
+ }, 1 + spread / width, 1 + spread / height);
10558
10562
  return tempMatrix;
10559
10563
  }
10560
10564
  return undefined;