pict-section-flow 2.0.1 → 2.0.2

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.1",
3
+ "version": "2.0.2",
4
4
  "description": "Pict Section Flow Diagram",
5
5
  "main": "source/Pict-Section-Flow.js",
6
6
  "scripts": {
@@ -962,6 +962,14 @@ class PictProviderFlowCSS extends libFableServiceProviderBase
962
962
  .pict-flow-panel-titlebar.dragging {
963
963
  cursor: grabbing;
964
964
  }
965
+ /* While a panel's foreignObject is dragged or resized, its x/y/height are rewritten on every
966
+ pointermove. A box-shadow on the HTML panel bleeds past the foreignObject box, and that bled
967
+ region is not in the per-move dirty rect, so the browser smears a copy of the shadow at the
968
+ old position (the "stuck shadow"). Drop the shadow for the duration of the gesture so there
969
+ is nothing to leave behind; it returns in place the moment the drag ends. */
970
+ .pict-flow-panel-foreign-object.pict-flow-panel-dragging .pict-flow-panel {
971
+ box-shadow: none;
972
+ }
965
973
  .pict-flow-panel-title-text {
966
974
  font-weight: 600;
967
975
  font-size: 12px;
@@ -985,6 +985,20 @@ class PictServiceFlowInteractionManager extends libFableServiceProviderBase
985
985
 
986
986
  // ---- Panel Dragging ----
987
987
 
988
+ // Toggle a "gesture in progress" marker on a panel's foreignObject. The panel CSS drops the
989
+ // panel box-shadow while this class is present: dragging/resizing rewrites the foreignObject
990
+ // geometry every pointermove, and the shadow (which bleeds outside the foreignObject box) would
991
+ // otherwise be smeared in place at each old position. No shadow during the gesture means none to
992
+ // leave behind; it returns when the class is removed at the end of the drag.
993
+ _setPanelGestureActive(pPanelHash, pIsActive)
994
+ {
995
+ if (!pPanelHash || !this._FlowView || !this._FlowView._PanelsLayer) { return; }
996
+ let tmpForeignObject = this._FlowView._PanelsLayer.querySelector('[data-panel-hash="' + pPanelHash + '"]');
997
+ if (!tmpForeignObject) { return; }
998
+ if (pIsActive) { tmpForeignObject.classList.add('pict-flow-panel-dragging'); }
999
+ else { tmpForeignObject.classList.remove('pict-flow-panel-dragging'); }
1000
+ }
1001
+
988
1002
  _startPanelDrag(pEvent, pTarget)
989
1003
  {
990
1004
  let tmpPanelHash = this._getPanelHash(pTarget);
@@ -999,6 +1013,7 @@ class PictServiceFlowInteractionManager extends libFableServiceProviderBase
999
1013
  this._DragPanelStartY = pEvent.clientY;
1000
1014
  this._DragPanelDataStartX = tmpPanel.X;
1001
1015
  this._DragPanelDataStartY = tmpPanel.Y;
1016
+ this._setPanelGestureActive(tmpPanelHash, true);
1002
1017
  }
1003
1018
 
1004
1019
  _onPanelDrag(pEvent)
@@ -1026,6 +1041,7 @@ class PictServiceFlowInteractionManager extends libFableServiceProviderBase
1026
1041
  this._FlowView._EventHandlerProvider.fireEvent('onFlowChanged', this._FlowView.flowData);
1027
1042
  }
1028
1043
 
1044
+ this._setPanelGestureActive(this._DragPanelHash, false);
1029
1045
  this._setState(INTERACTION_STATES.IDLE);
1030
1046
  this._DragPanelHash = null;
1031
1047
  }
@@ -1044,6 +1060,7 @@ class PictServiceFlowInteractionManager extends libFableServiceProviderBase
1044
1060
  this._ResizePanelHash = tmpPanelHash;
1045
1061
  this._ResizeStartY = pEvent.clientY;
1046
1062
  this._ResizePanelStartHeight = tmpPanel.Height;
1063
+ this._setPanelGestureActive(tmpPanelHash, true);
1047
1064
  }
1048
1065
 
1049
1066
  _onPanelResize(pEvent)
@@ -1083,6 +1100,7 @@ class PictServiceFlowInteractionManager extends libFableServiceProviderBase
1083
1100
  this._FlowView._EventHandlerProvider.fireEvent('onFlowChanged', this._FlowView.flowData);
1084
1101
  }
1085
1102
 
1103
+ this._setPanelGestureActive(this._ResizePanelHash, false);
1086
1104
  this._setState(INTERACTION_STATES.IDLE);
1087
1105
  this._ResizePanelHash = null;
1088
1106
  }