canvas-editor-engine 2.3.55 → 2.3.57
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.mjs +14 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -2611,13 +2611,22 @@ var DrawLayersService = function() {
|
|
2611
2611
|
status: "error",
|
2612
2612
|
message: "Replaceable layer not found"
|
2613
2613
|
});
|
2614
|
+
_this.layerList.sort((function(a, b) {
|
2615
|
+
return a.order - b.order;
|
2616
|
+
}));
|
2617
|
+
var layerIdx = _this.layerList.findIndex((function(layer) {
|
2618
|
+
return layer.id === id;
|
2619
|
+
}));
|
2620
|
+
var replaceableIdx = _this.layerList.findIndex((function(layer) {
|
2621
|
+
return layer.order === newOrder;
|
2622
|
+
}));
|
2623
|
+
_this.layerList.slice(layerIdx + 1, replaceableIdx + 1).forEach((function(layer, idx) {
|
2624
|
+
_this.layerList[idx].order = layer.order - 1;
|
2625
|
+
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", _this.layerList[idx]);
|
2626
|
+
}));
|
2614
2627
|
layer.order = newOrder;
|
2615
|
-
_this.layerList[
|
2628
|
+
_this.layerList[layerIdx] = layer;
|
2616
2629
|
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", layer);
|
2617
|
-
_this.layerList.slice(layerIndex + 1, replaceableIndex + 1).forEach((function(layer, index) {
|
2618
|
-
_this.layerList[index].order = layer.order - 1;
|
2619
|
-
_this.appStoreRepository.store.drawLayersState.reduce("UPDATE_LAYER", _this.layerList[index]);
|
2620
|
-
}));
|
2621
2630
|
} else {
|
2622
2631
|
layer.order = newOrder;
|
2623
2632
|
_this.layerList[layerIndex] = layer;
|