diff --git a/package.json b/package.json index 98a03e5..c226784 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "easy-marker", - "version": "1.1.23", + "version": "1.1.24", "description": "Easy marker", "main": "dist/easy-marker.esm.js", "scripts": { diff --git a/src/base_easy_marker.js b/src/base_easy_marker.js index 384f0c7..9fcd195 100644 --- a/src/base_easy_marker.js +++ b/src/base_easy_marker.js @@ -589,7 +589,7 @@ class EasyMarker { if (this.options.adjustTextStyleDisabled) return const { children } = this.container for (let i = 0; i < children.length; i++) { - children[i].style.zIndex = '40' + children[i].style.zIndex = '10'; // @fix 40 -> 10。理论上要比HighlightLine和Cursor等元素要低的吧 children[i].style.position = 'relative' } } diff --git a/src/element/highlight.js b/src/element/highlight.js index 021d6fc..8889cef 100644 --- a/src/element/highlight.js +++ b/src/element/highlight.js @@ -244,11 +244,13 @@ export default class Highlight extends BaseElement { } createLine(pointList) { + const line = document.createElementNS('http://www.w3.org/2000/svg', 'line') + if (!pointList[2] || !pointList[3]) return line; + const x1 = pointList[2][0] const y1 = pointList[2][1] + 1 const x2 = pointList[3][0] const y2 = pointList[3][1] + 1 - const line = document.createElementNS('http://www.w3.org/2000/svg', 'line') line.style.stroke = this.option.underlineColor line.style.strokeWidth = this.option.underlineWidth line.setAttribute('x1', x1)