+ const wrapperBox = wrapper.getBoundingClientRect();
const items = wrapper.querySelectorAll('.block_line .item');
const points = [];
for (const item of items) {
const element = item.querySelector('.num');
const box = element.getBoundingClientRect();
points.push({
- x: box.left + box.width / 2 + scrollX,
- y: box.top + box.height / 2 + scrollY
+ x: box.left + box.width / 2 - wrapperBox.left,
+ y: box.top + box.height / 2 - wrapperBox.top
});
}
points.push({
- x: box.left + box.width / 2,
+ x: box.left + box.width / 2 + scrollX,
- y: box.top + box.height / 2
+ y: box.top + box.height / 2 + scrollY
});