diff --git a/src/display/editor/highlight.js b/src/display/editor/highlight.js index 8082e686ccf52..b421c19e0b369 100644 --- a/src/display/editor/highlight.js +++ b/src/display/editor/highlight.js @@ -138,8 +138,7 @@ class HighlightEditor extends AnnotationEditor { this.parent.drawLayer.updateLine(this.#id, highlightOutlines); this.parent.drawLayer.updateLine(this.#outlineId, this.#focusOutlines); } - const { x, y, width, height, lastPoint } = highlightOutlines.box; - this.#lastPoint = lastPoint; + const { x, y, width, height } = highlightOutlines.box; switch (this.rotation) { case 0: this.x = x; @@ -170,6 +169,11 @@ class HighlightEditor extends AnnotationEditor { break; } } + const { lastPoint } = this.#focusOutlines.box; + this.#lastPoint = [ + (lastPoint[0] - this.x) / this.width, + (lastPoint[1] - this.y) / this.height, + ]; } /** @inheritdoc */ diff --git a/src/display/editor/outliner.js b/src/display/editor/outliner.js index d3b2c57f7f098..8f985e2fea60d 100644 --- a/src/display/editor/outliner.js +++ b/src/display/editor/outliner.js @@ -837,8 +837,6 @@ class FreeHighlightOutline extends Outline { y = minY - this.#innerMargin, width = maxX - minX + 2 * this.#innerMargin, height = maxY - minY + 2 * this.#innerMargin; - lastPointX = (lastPointX - x) / width; - lastPointY = (lastPointY - y) / height; this.#bbox = { x, y, width, height, lastPoint: [lastPointX, lastPointY] }; }