@anaralabs/lector 3.12.1 → 3.12.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/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5099,13 +5099,16 @@ var useViewportContainer = ({
|
|
|
5099
5099
|
const elementRect = currentElement.getBoundingClientRect();
|
|
5100
5100
|
const containerRect = currentContainer.getBoundingClientRect();
|
|
5101
5101
|
const currentZoom = transformations.current.zoom;
|
|
5102
|
+
const containerStyle = getComputedStyle(currentContainer);
|
|
5103
|
+
const paddingTop = parseFloat(containerStyle.paddingTop) || 0;
|
|
5104
|
+
const paddingLeft = parseFloat(containerStyle.paddingLeft) || 0;
|
|
5102
5105
|
const contentPosition = [
|
|
5103
5106
|
origin[0] - elementRect.left,
|
|
5104
5107
|
origin[1] - elementRect.top
|
|
5105
5108
|
];
|
|
5106
5109
|
const containerPosition = [
|
|
5107
|
-
origin[0] - containerRect.left,
|
|
5108
|
-
origin[1] - containerRect.top
|
|
5110
|
+
origin[0] - containerRect.left - paddingLeft,
|
|
5111
|
+
origin[1] - containerRect.top - paddingTop
|
|
5109
5112
|
];
|
|
5110
5113
|
originRef.current = [
|
|
5111
5114
|
contentPosition[0] / currentZoom,
|