md-editor-v3 4.16.4 → 4.16.5

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.
@@ -1353,7 +1353,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
1353
1353
  const curr = elesHasLineNumber[i];
1354
1354
  const sibling = elesHasLineNumber[i].previousElementSibling;
1355
1355
  if (curr.offsetTop + curr.offsetHeight > cMaxScrollLength && sibling.offsetTop < cMaxScrollLength) {
1356
- lineNumer = Number(curr.dataset.line);
1356
+ lineNumer = Number(sibling.dataset.line);
1357
1357
  break;
1358
1358
  }
1359
1359
  }
@@ -1440,8 +1440,8 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
1440
1440
  );
1441
1441
  let blockHeight = 0;
1442
1442
  if (endLineScrollTop > scrollDOM.scrollHeight - scrollDOM.clientHeight || realEleEnd.offsetTop + realEleEnd.offsetHeight > cEle.scrollHeight - cEle.clientHeight) {
1443
- scale = (cScrollTop + cEle.clientHeight - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop);
1444
- blockHeight = pEle.scrollHeight - firstLineScrollTop - pEle.clientHeight;
1443
+ scale = (cScrollTop - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop - cEle.clientHeight);
1444
+ blockHeight = scrollDOM.scrollHeight - firstLineScrollTop - scrollDOM.clientHeight;
1445
1445
  } else if (realEleStart === ((_f = cEle.firstElementChild) == null ? void 0 : _f.firstElementChild)) {
1446
1446
  if (realEleStart === realEleEnd) {
1447
1447
  eleEndOffsetTop = realEleEnd.offsetTop + realEleEnd.offsetHeight + +getComputedStyle(realEleEnd).marginBottom.replace("px", "");
@@ -1352,7 +1352,7 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
1352
1352
  const curr = elesHasLineNumber[i];
1353
1353
  const sibling = elesHasLineNumber[i].previousElementSibling;
1354
1354
  if (curr.offsetTop + curr.offsetHeight > cMaxScrollLength && sibling.offsetTop < cMaxScrollLength) {
1355
- lineNumer = Number(curr.dataset.line);
1355
+ lineNumer = Number(sibling.dataset.line);
1356
1356
  break;
1357
1357
  }
1358
1358
  }
@@ -1439,8 +1439,8 @@ const scrollAuto = (pEle, cEle, codeMirrorUt) => {
1439
1439
  );
1440
1440
  let blockHeight = 0;
1441
1441
  if (endLineScrollTop > scrollDOM.scrollHeight - scrollDOM.clientHeight || realEleEnd.offsetTop + realEleEnd.offsetHeight > cEle.scrollHeight - cEle.clientHeight) {
1442
- scale = (cScrollTop + cEle.clientHeight - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop);
1443
- blockHeight = pEle.scrollHeight - firstLineScrollTop - pEle.clientHeight;
1442
+ scale = (cScrollTop - eleStartOffsetTop) / (cEle.scrollHeight - eleStartOffsetTop - cEle.clientHeight);
1443
+ blockHeight = scrollDOM.scrollHeight - firstLineScrollTop - scrollDOM.clientHeight;
1444
1444
  } else if (realEleStart === ((_f = cEle.firstElementChild) == null ? void 0 : _f.firstElementChild)) {
1445
1445
  if (realEleStart === realEleEnd) {
1446
1446
  eleEndOffsetTop = realEleEnd.offsetTop + realEleEnd.offsetHeight + +getComputedStyle(realEleEnd).marginBottom.replace("px", "");