cytoscape-canvas-underlay 1.2.2 → 1.2.4

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/README.md CHANGED
@@ -438,6 +438,12 @@ These still work but the `on()`/`off()` event emitter is preferred.
438
438
  | `visible` | `boolean` | `true` | Visibility |
439
439
  | `rotation` | `number` | `0` | Rotation in degrees (0, 90, 180, 270) |
440
440
 
441
+ ## Changelog
442
+
443
+ ### 1.2.3
444
+
445
+ - **Fix**: `_springBackIfNeeded` now respects `panClamp: false`. Previously, setting `panClamp: false` at runtime disabled hard clamping but the soft spring-back animation on mouse release still fired, snapping the viewport back to drawing bounds. This made it impossible to programmatically disable pan clamping (e.g., during `panToElement` animations).
446
+
441
447
  ## How it works
442
448
 
443
449
  1. A `<canvas>` element is inserted behind Cytoscape's graph canvas
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cytoscape-canvas-underlay",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Cytoscape.js plugin for rendering image/PDF canvas underlay behind graph nodes with synchronized zoom and pan",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -295,6 +295,15 @@ export class DrawingOverlay {
295
295
  this._enforceLimits();
296
296
  this._draw();
297
297
  if (this._minimap) this._minimap.render();
298
+
299
+ // Schedule high-quality PDF re-render at current zoom level
300
+ const hasPdf = this._main.isPdf || [...this._drawings.values()].some(d => d.isPdf && d.visible);
301
+ if (hasPdf) {
302
+ if (this._qualityTimer) clearTimeout(this._qualityTimer);
303
+ this._qualityTimer = setTimeout(() => {
304
+ this._reRenderAllPdfs().then(() => this._draw());
305
+ }, this.opts.qualityDelay);
306
+ }
298
307
  };
299
308
  this._onResize = () => {
300
309
  this._setupCanvas();
@@ -470,7 +479,7 @@ export class DrawingOverlay {
470
479
 
471
480
  /** Animate spring-back to boundary on mouse release (fixed-duration ease-out). */
472
481
  _springBackIfNeeded() {
473
- if (this._isUserDragging || this.opts.panClampMode !== 'soft') return;
482
+ if (this._isUserDragging || !this.opts.panClamp || this.opts.panClampMode !== 'soft') return;
474
483
  this._cancelSpringBack();
475
484
 
476
485
  const b = this._getPanBounds();