@meta2d/core 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meta2d/core",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -4328,6 +4328,9 @@ var Canvas = /** @class */ (function () {
4328
4328
  });
4329
4329
  this.store.hover = undefined;
4330
4330
  }
4331
+ if (!this.mouseDown) {
4332
+ return;
4333
+ }
4331
4334
  var x = e.x - this.mouseDown.x;
4332
4335
  var y = e.y - this.mouseDown.y;
4333
4336
  e.shiftKey && !e.ctrlKey && (y = 0);
@@ -4477,6 +4480,8 @@ var Canvas = /** @class */ (function () {
4477
4480
  this.patchFlagsLines.add(line);
4478
4481
  this.store.path2dMap.set(line, globalStore.path2dDraws[line.name](line));
4479
4482
  this.render();
4483
+ this.store.active[0].calculative &&
4484
+ (this.store.active[0].calculative.gradientAnimatePath = undefined);
4480
4485
  if (this.timer) {
4481
4486
  clearTimeout(this.timer);
4482
4487
  }
@@ -5073,7 +5078,14 @@ var Canvas = /** @class */ (function () {
5073
5078
  continue;
5074
5079
  }
5075
5080
  if (typeof pen[k] !== 'object' || k === 'lineDash') {
5076
- pen[k] = pen.calculative[k];
5081
+ if (k === 'lineWidth') {
5082
+ pen[k] =
5083
+ pen.calculative[k] /
5084
+ pen.calculative.canvas.store.data.scale;
5085
+ }
5086
+ else {
5087
+ pen[k] = pen.calculative[k];
5088
+ }
5077
5089
  }
5078
5090
  }
5079
5091
  calcPenRect(pen);
@@ -5081,7 +5093,13 @@ var Canvas = /** @class */ (function () {
5081
5093
  else {
5082
5094
  for (var k in pen) {
5083
5095
  if (typeof pen[k] !== 'object' || k === 'lineDash') {
5084
- pen.calculative[k] = pen[k];
5096
+ if (k === 'lineWidth') {
5097
+ pen.calculative[k] =
5098
+ pen[k] * pen.calculative.canvas.store.data.scale;
5099
+ }
5100
+ else {
5101
+ pen.calculative[k] = pen[k];
5102
+ }
5085
5103
  }
5086
5104
  }
5087
5105
  }
@@ -5777,6 +5795,20 @@ var Canvas = /** @class */ (function () {
5777
5795
  pen.calculative.strokeImage = undefined;
5778
5796
  this.loadImage(pen);
5779
5797
  }
5798
+ if (data.lineGradientColors) {
5799
+ pen.calculative.lineGradient = undefined;
5800
+ pen.calculative.gradientColorStop = undefined;
5801
+ }
5802
+ if (data.gradientColors) {
5803
+ pen.calculative.gradient = undefined;
5804
+ pen.calculative.radialGradient = undefined;
5805
+ }
5806
+ if (data.animateLineWidth) {
5807
+ pen.calculative.gradientAnimatePath = undefined;
5808
+ }
5809
+ if (data.gradientSmooth) {
5810
+ pen.calculative.gradientAnimatePath = undefined;
5811
+ }
5780
5812
  if (containIsBottom) {
5781
5813
  this.canvasImage.init();
5782
5814
  this.canvasImageBottom.init();