@threedddplus/logoeditor 0.0.167 → 0.0.169

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.
@@ -4940,11 +4940,11 @@ var ToolTip = function ToolTip(_ref) {
4940
4940
  };
4941
4941
 
4942
4942
  var ActionButtons = function ActionButtons() {
4943
+ //@ts-ignore
4943
4944
  var _use3dddPlus = use3dddPlus(function (state) {
4944
4945
  return [state.fabricCanvas, state.activeSelection];
4945
4946
  }, shallow.shallow),
4946
- canvas = _use3dddPlus[0],
4947
- activeSelection = _use3dddPlus[1];
4947
+ canvas = _use3dddPlus[0];
4948
4948
  var selectAllHandler = function selectAllHandler() {
4949
4949
  canvas.discardActiveObject();
4950
4950
  var sel = new fabric.fabric.ActiveSelection(canvas.getObjects().filter(function (obj) {
@@ -4967,16 +4967,13 @@ var ActionButtons = function ActionButtons() {
4967
4967
  });
4968
4968
  };
4969
4969
  var deleteHandler = function deleteHandler() {
4970
- if (activeSelection) {
4971
- if (activeSelection.icon) {
4972
- canvas.remove(activeSelection);
4973
- removeItem(activeSelection);
4974
- } else if (activeSelection._objects) {
4975
- activeSelection._objects.map(function (obj) {
4976
- canvas.remove(obj);
4977
- removeItem(obj);
4978
- });
4979
- }
4970
+ if (canvas.getActiveObjects()) {
4971
+ canvas.getActiveObjects().forEach(function (element) {
4972
+ if (element.icon) {
4973
+ canvas.remove(element);
4974
+ removeItem(element);
4975
+ }
4976
+ });
4980
4977
  // canvas.remove(activeSelection);
4981
4978
  use3dddPlus.getState().updateModifaction(true);
4982
4979
  canvas.requestRenderAll();