|
@@ -376,7 +376,7 @@ export default {
|
|
|
let { offsetWidth, offsetLeft, offsetTop, offsetHeight } = document.getElementsByClassName(
|
|
|
`${isShowRightAnswer ? 'answer-' : ''}item-${mark}`,
|
|
|
)[0];
|
|
|
- const { curOffsetWidth, curOffsetLeft, curOffsetTop, curMark } = this.computedCurConnectionPoint(
|
|
|
+ const { curOffsetWidth, curOffsetLeft, curOffsetTop, curOffsetHeight, curMark } = this.computedCurConnectionPoint(
|
|
|
isDrag,
|
|
|
isShowRightAnswer,
|
|
|
);
|
|
@@ -387,7 +387,10 @@ export default {
|
|
|
? curOffsetLeft - offsetLeft + offsetWidth
|
|
|
: offsetLeft - curOffsetLeft + curOffsetWidth,
|
|
|
);
|
|
|
- let height = Math.abs(offsetTop - curOffsetTop);
|
|
|
+ let height =
|
|
|
+ curOffsetTop > offsetTop
|
|
|
+ ? Math.abs(offsetTop + offsetHeight / 2 - (curOffsetTop + curOffsetHeight / 2))
|
|
|
+ : Math.abs(offsetTop - curOffsetTop);
|
|
|
let size = offsetLeft > curOffsetLeft ? offsetTop > curOffsetTop : offsetTop < curOffsetTop; // 判断是左上还是右下
|
|
|
// 创建一个空的SVG元素
|
|
|
let svg = document.createElementNS(svgNS, 'svg');
|
|
@@ -425,7 +428,7 @@ export default {
|
|
|
curOffsetWidth: dom.offsetWidth,
|
|
|
curOffsetLeft: dom.offsetLeft,
|
|
|
curOffsetTop: dom.offsetTop,
|
|
|
- curOffsetHeight: dom.offsetHeight / 2,
|
|
|
+ curOffsetHeight: dom.offsetHeight,
|
|
|
curMark: mark,
|
|
|
};
|
|
|
},
|