@nasser-sw/fabric 7.0.1-beta22 → 7.0.1-beta24

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.
@@ -412,7 +412,7 @@ class Cache {
412
412
  }
413
413
  const cache = new Cache();
414
414
 
415
- var version = "7.0.1-beta21";
415
+ var version = "7.0.1-beta23";
416
416
 
417
417
  // use this syntax so babel plugin see this import here
418
418
  const VERSION = version;
@@ -31041,6 +31041,13 @@ class Frame extends Group {
31041
31041
  this._editModeObjectCaching = this.objectCaching;
31042
31042
  this.objectCaching = false;
31043
31043
 
31044
+ // Force clear any existing cache
31045
+ this.dirty = true;
31046
+ if (this._cacheCanvas) {
31047
+ this._cacheCanvas = null;
31048
+ this._cacheContext = null;
31049
+ }
31050
+
31044
31051
  // Enable sub-target interaction so clicks go through to content
31045
31052
  this.subTargetCheck = true;
31046
31053
  this.interactive = true;
@@ -31051,16 +31058,21 @@ class Frame extends Group {
31051
31058
  const minScale = this._calculateCoverScale(originalWidth, originalHeight);
31052
31059
 
31053
31060
  // Make content image interactive with scale constraint
31061
+ // Also disable its caching to ensure it renders fully
31054
31062
  this._contentImage.set({
31055
31063
  selectable: true,
31056
31064
  evented: true,
31057
31065
  hasControls: true,
31058
31066
  hasBorders: true,
31059
31067
  minScaleLimit: minScale,
31060
- lockScalingFlip: true
31068
+ lockScalingFlip: true,
31069
+ objectCaching: false
31061
31070
  });
31071
+ this._contentImage.dirty = true;
31062
31072
 
31063
- // Store clip path but keep rendering it for the overlay effect
31073
+ // Store and remove clipPath to show full image
31074
+ // We must actually remove it (not just skip rendering) because Fabric's
31075
+ // rendering pipeline checks clipPath existence in multiple places
31064
31076
  if (this.clipPath) {
31065
31077
  this._editModeClipPath = this.clipPath;
31066
31078
  this.clipPath = undefined;
@@ -31155,6 +31167,38 @@ class Frame extends Group {
31155
31167
  this._boundConstrainScale = undefined;
31156
31168
  }
31157
31169
  }
31170
+ /**
31171
+ * Override shouldCache to prevent caching during edit mode.
31172
+ * This ensures the full image is rendered without cache-based clipping.
31173
+ * @override
31174
+ */
31175
+ shouldCache() {
31176
+ if (this.isEditMode) {
31177
+ this.ownCaching = false;
31178
+ return false;
31179
+ }
31180
+ return super.shouldCache();
31181
+ }
31182
+
31183
+ /**
31184
+ * Override drawObject to skip clipPath rendering during edit mode.
31185
+ * This prevents coordinate recalculation issues with viewport transforms.
31186
+ * @override
31187
+ */
31188
+ drawObject(ctx, forClipping, context) {
31189
+ this._renderBackground(ctx);
31190
+ for (let i = 0; i < this._objects.length; i++) {
31191
+ const obj = this._objects[i];
31192
+ if (obj.group === this) {
31193
+ obj.render(ctx);
31194
+ }
31195
+ }
31196
+ // Skip clipPath rendering in edit mode to show full image
31197
+ if (!this.isEditMode) {
31198
+ this._drawClipPath(ctx, this.clipPath, context);
31199
+ }
31200
+ }
31201
+
31158
31202
  /**
31159
31203
  * Custom render to show edit mode overlay
31160
31204
  * @override
@@ -31301,20 +31345,19 @@ class Frame extends Group {
31301
31345
  contentScale: currentScale
31302
31346
  };
31303
31347
 
31304
- // Make content non-interactive again
31348
+ // Make content non-interactive again and restore caching
31305
31349
  this._contentImage.set({
31306
31350
  selectable: false,
31307
31351
  evented: false,
31308
31352
  hasControls: false,
31309
- hasBorders: false
31353
+ hasBorders: false,
31354
+ objectCaching: true
31310
31355
  });
31311
31356
 
31312
31357
  // Restore clip path
31313
31358
  if (this._editModeClipPath) {
31314
31359
  this.clipPath = this._editModeClipPath;
31315
31360
  this._editModeClipPath = undefined;
31316
- } else {
31317
- this._updateClipPath();
31318
31361
  }
31319
31362
 
31320
31363
  // Restore caching setting