canvas-editor-engine 2.3.40 → 2.3.42

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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -7
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -2635,7 +2635,7 @@ var DrawAccumulatorService = function() {
2635
2635
  };
2636
2636
  DrawAccumulatorService.prototype.removePainter = function(painterId) {
2637
2637
  return __awaiter(this, void 0, void 0, (function() {
2638
- var painter, filteredPainters;
2638
+ var painter, filteredPainters, len;
2639
2639
  var _this = this;
2640
2640
  return __generator(this, (function(_a) {
2641
2641
  painter = this.painters.find((function(painter) {
@@ -2645,13 +2645,22 @@ var DrawAccumulatorService = function() {
2645
2645
  filteredPainters = this.painters.filter((function(painter) {
2646
2646
  return painter.id !== painterId;
2647
2647
  }));
2648
- if (!(filteredPainters === null || filteredPainters === void 0 ? void 0 : filteredPainters.length)) return [ 2, console.warn("Painter not found") ];
2649
2648
  this.painters = createDynamicPainterStore();
2650
- filteredPainters.forEach((function(painter) {
2651
- _this.painters.push({
2652
- object: painter,
2653
- update: _this.update.bind(_this)
2654
- });
2649
+ len = filteredPainters === null || filteredPainters === void 0 ? void 0 : filteredPainters.length;
2650
+ filteredPainters.forEach((function(painter, index) {
2651
+ if (len - 1 === index) {
2652
+ _this.painters.push({
2653
+ object: painter,
2654
+ update: _this.update.bind(_this)
2655
+ });
2656
+ } else {
2657
+ _this.painters.push({
2658
+ object: painter,
2659
+ update: function() {
2660
+ return undefined;
2661
+ }
2662
+ });
2663
+ }
2655
2664
  }));
2656
2665
  this.drawLayersService.removePainter(painterId);
2657
2666
  this.update();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "2.3.40",
3
+ "version": "2.3.42",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",