@anu3ev/fabric-image-editor 0.4.0 → 0.4.1

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/main.js +2 -0
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -4033,6 +4033,7 @@ class k {
4033
4033
  var Z, G, W, tt, et, st, nt, ot, at, it, rt, ct, dt, lt;
4034
4034
  const { target: n, transform: o } = s;
4035
4035
  if (!k._isTextbox(n) || !o) return;
4036
+ n.isScaling = !0;
4036
4037
  const a = this._ensureScalingState(n), { baseWidth: i, baseLeft: r, baseFontSize: c } = a, d = typeof ((Z = o.original) == null ? void 0 : Z.width) == "number" ? o.original.width : void 0, l = typeof ((G = o.original) == null ? void 0 : G.left) == "number" ? o.original.left : void 0, u = d != null ? d : i, g = l != null ? l : r, f = (W = o.corner) != null ? W : "", m = (tt = o.action) != null ? tt : "", b = ["ml", "mr"].includes(f) || m === "scaleX", p = ["mt", "mb"].includes(f) || m === "scaleY", M = ["tl", "tr", "bl", "br"].includes(f) || m === "scale";
4037
4038
  if (!b && !p && !M) return;
4038
4039
  const S = Math.abs((st = (et = n.scaleX) != null ? et : o.scaleX) != null ? st : 1) || 1, O = Math.abs((ot = (nt = n.scaleY) != null ? nt : o.scaleY) != null ? ot : 1) || 1, T = Math.max(1, u * S), y = Math.max(1, c * O), A = (it = (at = o.originX) != null ? at : n.originX) != null ? it : "left", N = g + u, I = g + u / 2, v = (rt = n.width) != null ? rt : u, w = Math.abs(T - v) > Et, L = Math.abs(y - ((ct = n.fontSize) != null ? ct : c)) > Et;
@@ -4055,6 +4056,7 @@ class k {
4055
4056
  var r, c, d;
4056
4057
  const { target: n } = s;
4057
4058
  if (!k._isTextbox(n)) return;
4059
+ n.isScaling = !1;
4058
4060
  const o = this.scalingState.get(n);
4059
4061
  if (this.scalingState.delete(n), !(o != null && o.hasWidthChange)) return;
4060
4062
  const a = (r = n.width) != null ? r : n.calcTextWidth(), i = (d = (c = n.fontSize) != null ? c : o == null ? void 0 : o.baseFontSize) != null ? d : 16;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anu3ev/fabric-image-editor",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "JavaScript image editor built on FabricJS, allowing you to create instances with an integrated montage area and providing an API to modify and manage state.",
5
5
  "module": "dist/main.js",
6
6
  "files": [