Skip to content

Commit 99b6fe9

Browse files
chore: rename props
1 parent c27c937 commit 99b6fe9

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

packages/main/src/Popover.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ class Popover extends Popup {
240240
_minHeight?: number;
241241
_resized = false;
242242

243-
_resizingDeltaX?: number;
244-
_resizingDeltaY?: number;
243+
_currDeltaX?: number;
244+
_currDeltaY?: number;
245245

246-
_resizedDeltaX?: number;
247-
_resizedDeltaY?: number;
246+
_accumulatedDeltaX?: number;
247+
_accumulatedDeltaY?: number;
248248

249249
_initialWidth?: string;
250250
_initialHeight?: string;
@@ -320,11 +320,11 @@ class Popover extends Popup {
320320
if (this._resized) {
321321
this._resized = false;
322322

323-
delete this._resizingDeltaX;
324-
delete this._resizingDeltaY;
323+
delete this._currDeltaX;
324+
delete this._currDeltaY;
325325

326-
delete this._resizedDeltaX;
327-
delete this._resizedDeltaY;
326+
delete this._accumulatedDeltaX;
327+
delete this._accumulatedDeltaY;
328328
}
329329

330330
super.closePopup(escPressed, preventRegistryUpdate, preventFocusRestore);
@@ -871,7 +871,7 @@ class Popover extends Popup {
871871
case PopoverActualHorizontalAlign.Stretch:
872872
left = targetRect.left - (popoverSize.width - targetRect.width) / 2;
873873
if (this._resized) {
874-
left -= this._resizingDeltaX || 0;
874+
left -= this._currDeltaX || 0;
875875
}
876876
break;
877877
case PopoverActualHorizontalAlign.Left:
@@ -893,7 +893,7 @@ class Popover extends Popup {
893893
case PopoverVerticalAlign.Stretch:
894894
top = targetRect.top - (popoverSize.height - targetRect.height) / 2;
895895
if (this._resized) {
896-
top -= this._resizingDeltaY || 0;
896+
top -= this._currDeltaY || 0;
897897
}
898898
break;
899899
case PopoverVerticalAlign.Top:
@@ -1055,8 +1055,8 @@ class Popover extends Popup {
10551055
this._resized = true;
10561056
this._initialBoundingRect = this.getBoundingClientRect();
10571057

1058-
this._resizedDeltaX = this._resizingDeltaX;
1059-
this._resizedDeltaY = this._resizingDeltaY;
1058+
this._accumulatedDeltaX = this._currDeltaX;
1059+
this._accumulatedDeltaY = this._currDeltaY;
10601060

10611061
const {
10621062
minWidth,
@@ -1116,7 +1116,7 @@ class Popover extends Popup {
11161116
// Recalculate width based on actual left position to stay within viewport with margin
11171117
newWidth = Math.min(newWidth, initialBoundingRect.x + initialBoundingRect.width - newLeft);
11181118

1119-
this._resizingDeltaX = (initialBoundingRect.x - newLeft) / 2;
1119+
this._currDeltaX = (initialBoundingRect.x - newLeft) / 2;
11201120
} else {
11211121
// Resizing from right edge - width increases when moving right (positive delta)
11221122
const maxWidthFromRight = window.innerWidth - initialBoundingRect.x - margin;
@@ -1127,7 +1127,7 @@ class Popover extends Popup {
11271127
maxWidthFromRight,
11281128
);
11291129

1130-
this._resizingDeltaX = (initialBoundingRect.width - newWidth) / 2;
1130+
this._currDeltaX = (initialBoundingRect.width - newWidth) / 2;
11311131
}
11321132

11331133
// Calculate height changes
@@ -1152,7 +1152,7 @@ class Popover extends Popup {
11521152
// Recalculate height based on actual top position to stay within viewport with margin
11531153
newHeight = Math.min(newHeight, initialBoundingRect.y + initialBoundingRect.height - newTop);
11541154

1155-
this._resizingDeltaY = (initialBoundingRect.y - newTop) / 2;
1155+
this._currDeltaY = (initialBoundingRect.y - newTop) / 2;
11561156
} else {
11571157
// Resizing from bottom edge - height increases when moving down (positive delta)
11581158
const maxHeightFromBottom = window.innerHeight - initialBoundingRect.y - margin;
@@ -1163,11 +1163,11 @@ class Popover extends Popup {
11631163
maxHeightFromBottom,
11641164
);
11651165

1166-
this._resizingDeltaY = (initialBoundingRect.height - newHeight) / 2;
1166+
this._currDeltaY = (initialBoundingRect.height - newHeight) / 2;
11671167
}
11681168

1169-
this._resizingDeltaX += this._resizedDeltaX || 0;
1170-
this._resizingDeltaY += this._resizedDeltaY || 0;
1169+
this._currDeltaX += this._accumulatedDeltaX || 0;
1170+
this._currDeltaY += this._accumulatedDeltaY || 0;
11711171

11721172
Object.assign(this.style, {
11731173
height: `${newHeight}px`,

0 commit comments

Comments
 (0)