publ-echo 0.0.35 → 0.0.37
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.
|
@@ -15,8 +15,8 @@ export function calcGridItemPosition(positionParams, x, y, z, w, h, state) {
|
|
|
15
15
|
var colWidth = calcGridColWidth(positionParams);
|
|
16
16
|
var rowHeightNumber = resolveRowHeight(rowHeight, colWidth);
|
|
17
17
|
var result = {
|
|
18
|
-
left: Math.
|
|
19
|
-
top: Math.
|
|
18
|
+
left: Math.ceil((colWidth + margin[0]) * x + containerPadding[0]),
|
|
19
|
+
top: Math.ceil((rowHeightNumber + margin[1]) * y + containerPadding[1]),
|
|
20
20
|
width: w === Infinity ? w : calcGridItemWHPx(w, colWidth, margin[0]),
|
|
21
21
|
height: h === Infinity ? h : calcGridItemWHPx(h, rowHeightNumber, margin[1]),
|
|
22
22
|
z: z,
|
|
@@ -36,8 +36,10 @@ export function calcGridItemPosition(positionParams, x, y, z, w, h, state) {
|
|
|
36
36
|
result.left = Math.round(state.dragging.left);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
result.top = Math.
|
|
40
|
-
result.left = Math.
|
|
39
|
+
result.top = Math.ceil((rowHeightNumber + margin[1]) * y + containerPadding[1]);
|
|
40
|
+
result.left = Math.ceil((colWidth + margin[0]) * x + containerPadding[0]);
|
|
41
|
+
console.log(result.left);
|
|
42
|
+
console.log({ colWidth: colWidth, margin0: margin[0], x: x, containerPadding: containerPadding[0] });
|
|
41
43
|
}
|
|
42
44
|
return result;
|
|
43
45
|
}
|
|
@@ -183,7 +183,7 @@ var ReactGridLayout = function (_a) {
|
|
|
183
183
|
};
|
|
184
184
|
/**
|
|
185
185
|
* When dragging stops, figure out which position the element is closest to and update its x and y.
|
|
186
|
-
* @param
|
|
186
|
+
* @param {String} i Index of the child.
|
|
187
187
|
* @param {Number} x X position of the move
|
|
188
188
|
* @param {Number} y Y position of the move
|
|
189
189
|
* @param {Event} e The mousedown event
|