saltfish 0.2.2 → 0.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.
@@ -5988,18 +5988,26 @@ class CursorManager {
5988
5988
  * Called via requestAnimationFrame for smooth updates
5989
5989
  */
5990
5990
  updateCursorPositionOnScroll() {
5991
- var _a;
5991
+ var _a, _b;
5992
5992
  if (!this.currentTargetElement) {
5993
5993
  return;
5994
5994
  }
5995
5995
  const targetRect = this.currentTargetElement.getBoundingClientRect();
5996
- const newX = targetRect.left + targetRect.width / 2;
5997
- const newY = targetRect.top + targetRect.height / 2;
5996
+ let newX;
5997
+ let newY;
5998
+ if (this.isSelectionMode) {
5999
+ const padding = this.getPaddingFromStyles((_a = this.currentAnimation) == null ? void 0 : _a.selectionStyles);
6000
+ newX = targetRect.right + padding + this.SELECTION_HORIZONTAL_OFFSET;
6001
+ newY = targetRect.bottom + padding + this.SELECTION_VERTICAL_OFFSET;
6002
+ } else {
6003
+ newX = targetRect.left + targetRect.width / 2 + this.POINTER_HORIZONTAL_OFFSET;
6004
+ newY = targetRect.top + targetRect.height / 2 + this.POINTER_VERTICAL_OFFSET;
6005
+ }
5998
6006
  this.show(newX, newY);
5999
6007
  this.lastCursorX = newX;
6000
6008
  this.lastCursorY = newY;
6001
6009
  if (this.selectionElement && this.isSelectionMode) {
6002
- const padding = this.getPaddingFromStyles((_a = this.currentAnimation) == null ? void 0 : _a.selectionStyles);
6010
+ const padding = this.getPaddingFromStyles((_b = this.currentAnimation) == null ? void 0 : _b.selectionStyles);
6003
6011
  const left = Math.floor(targetRect.left - padding);
6004
6012
  const top = Math.floor(targetRect.top - padding);
6005
6013
  const width = Math.ceil(targetRect.width + padding * 2);