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

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.
package/dist/index.mjs CHANGED
@@ -354,7 +354,7 @@ class Cache {
354
354
  }
355
355
  const cache = new Cache();
356
356
 
357
- var version = "7.0.1-beta17";
357
+ var version = "7.0.1-beta19";
358
358
 
359
359
  // use this syntax so babel plugin see this import here
360
360
  const VERSION = version;
@@ -8624,6 +8624,24 @@ class Control {
8624
8624
  */
8625
8625
  render(ctx, left, top, styleOverride, fabricObject) {
8626
8626
  styleOverride = styleOverride || {};
8627
+
8628
+ // Auto-detect side controls by position and use pill renderers
8629
+ // Side controls have one axis at 0: ml/mr have y=0, mt/mb have x=0
8630
+ const isSideControl = (this.x === 0 || this.y === 0) && !(this.x === 0 && this.y === 0);
8631
+ if (isSideControl && !styleOverride.cornerStyle) {
8632
+ // Horizontal pills for left/right (y = 0)
8633
+ if (this.y === 0 && this.x !== 0) {
8634
+ renderHorizontalPillControl.call(this, ctx, left, top, styleOverride, fabricObject);
8635
+ return;
8636
+ }
8637
+ // Vertical pills for top/bottom (x = 0)
8638
+ if (this.x === 0 && this.y !== 0) {
8639
+ renderVerticalPillControl.call(this, ctx, left, top, styleOverride, fabricObject);
8640
+ return;
8641
+ }
8642
+ }
8643
+
8644
+ // Corner controls and rotation use cornerStyle
8627
8645
  switch (styleOverride.cornerStyle || fabricObject.cornerStyle) {
8628
8646
  case 'circle':
8629
8647
  renderCircleControl.call(this, ctx, left, top, styleOverride, fabricObject);