pict-section-flow 2.0.0 → 2.0.1

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.0",
3
+ "version": "2.0.1",
4
4
  "description": "Pict Section Flow Diagram",
5
5
  "main": "source/Pict-Section-Flow.js",
6
6
  "scripts": {
@@ -192,11 +192,23 @@ class PictServiceFlowRenderManager extends libFableServiceProviderBase
192
192
  // Reset customized handle positions for connections/tethers involving this node
193
193
  this._FlowView._resetHandlesForNode(pNodeHash);
194
194
 
195
- // Update the node's SVG group transform for smooth dragging
195
+ // Update the node's SVG group transform for smooth dragging. PRESERVE the node's rotation -- a bare
196
+ // translate here flattened a rotated card back to upright the instant you started dragging (matches
197
+ // PictViewFlowNode.nodeTransform: rotate about the node center).
196
198
  let tmpNodeGroup = this._FlowView._NodesLayer.querySelector(`[data-node-hash="${pNodeHash}"]`);
197
199
  if (tmpNodeGroup)
198
200
  {
199
- tmpNodeGroup.setAttribute('transform', `translate(${pX}, ${pY})`);
201
+ let tmpRotation = (typeof tmpNode.Rotation === 'number') ? tmpNode.Rotation : 0;
202
+ if (tmpRotation)
203
+ {
204
+ let tmpW = (typeof tmpNode.Width === 'number') ? tmpNode.Width : (this._FlowView.options.DefaultNodeWidth || 180);
205
+ let tmpH = (typeof tmpNode.Height === 'number') ? tmpNode.Height : (this._FlowView.options.DefaultNodeHeight || 80);
206
+ tmpNodeGroup.setAttribute('transform', `translate(${pX}, ${pY}) rotate(${tmpRotation} ${tmpW / 2} ${tmpH / 2})`);
207
+ }
208
+ else
209
+ {
210
+ tmpNodeGroup.setAttribute('transform', `translate(${pX}, ${pY})`);
211
+ }
200
212
  }
201
213
 
202
214
  // Re-render connections that involve this node