@vectoriox/iox-builder 3.3.3 → 3.3.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.
@@ -1140,6 +1140,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
1140
1140
  type: Injectable
1141
1141
  }] });
1142
1142
 
1143
+ /**
1144
+ * Per-frame exponential smoothing step — moves `current` a fraction of the way
1145
+ * toward `target`. Used to ease the drag ghost toward the pointer instead of
1146
+ * snapping to it 1:1 on every dragmove (see DragEngineService._ghostFollowStep).
1147
+ */
1148
+ function easeToward(current, target, smoothing) {
1149
+ return current + (target - current) * smoothing;
1150
+ }
1151
+
1143
1152
  /**
1144
1153
  * SymbolRegistryService — in-memory store for org-level symbols.
1145
1154
  *
@@ -1268,8 +1277,8 @@ class DragEngineService {
1268
1277
  this._ghostRaf = 0;
1269
1278
  return;
1270
1279
  }
1271
- this._ghostX += (this._ghostTargetX - this._ghostX) * GHOST_FOLLOW_SMOOTHING;
1272
- this._ghostY += (this._ghostTargetY - this._ghostY) * GHOST_FOLLOW_SMOOTHING;
1280
+ this._ghostX = easeToward(this._ghostX, this._ghostTargetX, GHOST_FOLLOW_SMOOTHING);
1281
+ this._ghostY = easeToward(this._ghostY, this._ghostTargetY, GHOST_FOLLOW_SMOOTHING);
1273
1282
  this._overlay.style.left = this._ghostX + 'px';
1274
1283
  this._overlay.style.top = this._ghostY + 'px';
1275
1284
  this._ghostRaf = requestAnimationFrame(this._ghostFollowStep);