pict-section-flow 2.0.2 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-flow",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Pict Section Flow Diagram",
5
5
  "main": "source/Pict-Section-Flow.js",
6
6
  "scripts": {
@@ -70,9 +70,12 @@ class PictServiceFlowViewportManager extends libFableServiceProviderBase
70
70
  }
71
71
 
72
72
  /**
73
- * Zoom to fit all nodes in the viewport
73
+ * Zoom to fit all nodes in the viewport.
74
+ * @param {boolean} pAllowZoomIn - when true the fit may scale UP past 1.0 (to MaxZoom) so a small board
75
+ * fills the viewport. Default (falsy) keeps the historic behavior: never zoom in past 1.0, so content
76
+ * stays true-to-scale and a sparse map does not balloon. Presentation banners opt in.
74
77
  */
75
- zoomToFit()
78
+ zoomToFit(pAllowZoomIn)
76
79
  {
77
80
  if (this._FlowView._FlowData.Nodes.length === 0) return;
78
81
  if (!this._FlowView._SVGElement) return;
@@ -96,7 +99,8 @@ class PictServiceFlowViewportManager extends libFableServiceProviderBase
96
99
  let tmpSVGRect = this._FlowView._SVGElement.getBoundingClientRect();
97
100
  let tmpScaleX = tmpSVGRect.width / tmpFlowWidth;
98
101
  let tmpScaleY = tmpSVGRect.height / tmpFlowHeight;
99
- let tmpZoom = Math.min(tmpScaleX, tmpScaleY, 1.0); // Don't zoom in past 1.0
102
+ let tmpZoom = Math.min(tmpScaleX, tmpScaleY);
103
+ if (!pAllowZoomIn) { tmpZoom = Math.min(tmpZoom, 1.0); } // Don't zoom in past 1.0 unless the caller opts in
100
104
  tmpZoom = Math.max(this._FlowView.options.MinZoom, Math.min(this._FlowView.options.MaxZoom, tmpZoom));
101
105
 
102
106
  let tmpCenterX = (tmpMinX + tmpMaxX) / 2;
@@ -1297,11 +1297,12 @@ class PictViewFlow extends libPictView
1297
1297
  }
1298
1298
 
1299
1299
  /**
1300
- * Zoom to fit all nodes in the viewport
1300
+ * Zoom to fit all nodes in the viewport.
1301
+ * @param {boolean} pAllowZoomIn - when true the fit may scale up past 1.0 (presentation banners opt in).
1301
1302
  */
1302
- zoomToFit()
1303
+ zoomToFit(pAllowZoomIn)
1303
1304
  {
1304
- return this._ViewportManager.zoomToFit();
1305
+ return this._ViewportManager.zoomToFit(pAllowZoomIn);
1305
1306
  }
1306
1307
 
1307
1308
  /**