@threedddplus/logoeditor 0.0.166 → 0.0.168

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.
@@ -4932,11 +4932,11 @@ var ToolTip = function ToolTip(_ref) {
4932
4932
  };
4933
4933
 
4934
4934
  var ActionButtons = function ActionButtons() {
4935
+ //@ts-ignore
4935
4936
  var _use3dddPlus = use3dddPlus(function (state) {
4936
4937
  return [state.fabricCanvas, state.activeSelection];
4937
4938
  }, shallow),
4938
- canvas = _use3dddPlus[0],
4939
- activeSelection = _use3dddPlus[1];
4939
+ canvas = _use3dddPlus[0];
4940
4940
  var selectAllHandler = function selectAllHandler() {
4941
4941
  canvas.discardActiveObject();
4942
4942
  var sel = new fabric.ActiveSelection(canvas.getObjects().filter(function (obj) {
@@ -4959,16 +4959,13 @@ var ActionButtons = function ActionButtons() {
4959
4959
  });
4960
4960
  };
4961
4961
  var deleteHandler = function deleteHandler() {
4962
- if (activeSelection) {
4963
- if (activeSelection.icon) {
4964
- canvas.remove(activeSelection);
4965
- removeItem(activeSelection);
4966
- } else if (activeSelection._objects) {
4967
- activeSelection._objects.map(function (obj) {
4968
- canvas.remove(obj);
4969
- removeItem(obj);
4970
- });
4971
- }
4962
+ if (canvas.getActiveObjects()) {
4963
+ canvas.getActiveObjects().forEach(function (element) {
4964
+ if (element.icon) {
4965
+ canvas.remove(element);
4966
+ removeItem(element);
4967
+ }
4968
+ });
4972
4969
  // canvas.remove(activeSelection);
4973
4970
  use3dddPlus.getState().updateModifaction(true);
4974
4971
  canvas.requestRenderAll();