@nasser-sw/fabric 7.0.1-beta19 → 7.0.1-beta20

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.
@@ -9656,7 +9656,51 @@ class InteractiveFabricObject extends FabricObject$1 {
9656
9656
  * @param {ControlRenderingStyleOverride} styleOverride object to override the object style
9657
9657
  */
9658
9658
  drawControls(ctx) {
9659
+ var _this$canvas;
9659
9660
  let styleOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9661
+ // Check if object is being actively transformed (Canva-style control visibility)
9662
+ // Only hide controls when actually dragging, not just on click/select
9663
+ const currentTransform = (_this$canvas = this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas._currentTransform;
9664
+ const isActivelyTransforming = currentTransform && currentTransform.target === this && this.isMoving; // isMoving is true only during actual drag
9665
+
9666
+ if (isActivelyTransforming) {
9667
+ const activeCorner = currentTransform.corner;
9668
+
9669
+ // Moving (no active corner) - don't draw any controls, just border
9670
+ if (!activeCorner) {
9671
+ return;
9672
+ }
9673
+
9674
+ // Scaling/rotating - only draw the active control
9675
+ const control = this.controls[activeCorner];
9676
+ if (control && control.getVisibility(this, activeCorner)) {
9677
+ ctx.save();
9678
+ const retinaScaling = this.getCanvasRetinaScaling();
9679
+ const {
9680
+ cornerStrokeColor,
9681
+ cornerDashArray,
9682
+ cornerColor
9683
+ } = this;
9684
+ const options = {
9685
+ cornerStrokeColor,
9686
+ cornerDashArray,
9687
+ cornerColor,
9688
+ ...styleOverride
9689
+ };
9690
+ ctx.setTransform(retinaScaling, 0, 0, retinaScaling, 0, 0);
9691
+ ctx.strokeStyle = ctx.fillStyle = options.cornerColor;
9692
+ if (!this.transparentCorners) {
9693
+ ctx.strokeStyle = options.cornerStrokeColor;
9694
+ }
9695
+ this._setLineDash(ctx, options.cornerDashArray);
9696
+ const p = this.oCoords[activeCorner];
9697
+ control.render(ctx, p.x, p.y, options, this);
9698
+ ctx.restore();
9699
+ }
9700
+ return;
9701
+ }
9702
+
9703
+ // Normal rendering - draw all controls
9660
9704
  ctx.save();
9661
9705
  const retinaScaling = this.getCanvasRetinaScaling();
9662
9706
  const {