@threedddplus/logoeditor 0.0.55 → 0.0.56

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.
@@ -2640,6 +2640,8 @@ var fabricSlice = function fabricSlice(set, get) {
2640
2640
  use3dddPlus.setState({
2641
2641
  selectedStepper: undefined
2642
2642
  });
2643
+ // Update layers
2644
+ use3dddPlus.getState().clearLayers();
2643
2645
  canvas.getObjects().forEach(function (element) {
2644
2646
  element.id = use3dddPlus.getState().guid();
2645
2647
  if (element.type !== "line") {
@@ -4107,7 +4109,7 @@ var ActionButtons = function ActionButtons() {
4107
4109
  visible: true
4108
4110
  }];
4109
4111
  return React.createElement(React.Fragment, null, React.createElement("div", {
4110
- className: "w-100 flex px-3 items-center z-10 bg-[#ffffff] h-[40px]",
4112
+ className: "w-100 flex px-3 items-center z-10 h-[40px]",
4111
4113
  style: {
4112
4114
  justifyContent: 'flex-end'
4113
4115
  }
@@ -4366,8 +4368,8 @@ var initCanvas = function initCanvas() {
4366
4368
  obj.top = top1;
4367
4369
  obj.scaleX = scale1x;
4368
4370
  obj.scaleY = scale1y;
4369
- obj.width = width1;
4370
- obj.height = height1;
4371
+ // obj.width = width1;
4372
+ // obj.height = height1;
4371
4373
  } else {
4372
4374
  left1 = obj.left;
4373
4375
  top1 = obj.top;
@@ -7977,10 +7979,11 @@ var Rightmenu = function Rightmenu() {
7977
7979
  if (currentSelection === 'path') {
7978
7980
  textShapeChange(textSelected.shapeType, true);
7979
7981
  }
7980
- var textWidth = textSelected.width;
7981
- var canvasWidth = canvas.width - textSelected.left;
7982
- if (textWidth > canvasWidth) {
7983
- var newFontSize = canvasWidth / textWidth * textSelected.fontSize;
7982
+ // let textWidth = textSelected.width;
7983
+ var canvasWidth = canvas.width;
7984
+ var brNew = textSelected.getBoundingRect();
7985
+ if (brNew.width + brNew.left >= textSelected.canvas.width - 5) {
7986
+ var newFontSize = canvasWidth / (brNew.width + brNew.left) * textSelected.fontSize;
7984
7987
  textSelected.set('fontSize', newFontSize);
7985
7988
  }
7986
7989
  textSelected.set('text', use3dddPlus.getState().textInfo);