Skip to content

Commit 833d7ac

Browse files
authored
Merge pull request #17602 from calixteman/editor_free_highlight_lastpoint
[Editor] Fix the position of the free highlight toolbar
2 parents 245fd02 + 7529c1e commit 833d7ac

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/display/editor/highlight.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ class HighlightEditor extends AnnotationEditor {
138138
this.parent.drawLayer.updateLine(this.#id, highlightOutlines);
139139
this.parent.drawLayer.updateLine(this.#outlineId, this.#focusOutlines);
140140
}
141-
const { x, y, width, height, lastPoint } = highlightOutlines.box;
142-
this.#lastPoint = lastPoint;
141+
const { x, y, width, height } = highlightOutlines.box;
143142
switch (this.rotation) {
144143
case 0:
145144
this.x = x;
@@ -170,6 +169,11 @@ class HighlightEditor extends AnnotationEditor {
170169
break;
171170
}
172171
}
172+
const { lastPoint } = this.#focusOutlines.box;
173+
this.#lastPoint = [
174+
(lastPoint[0] - this.x) / this.width,
175+
(lastPoint[1] - this.y) / this.height,
176+
];
173177
}
174178

175179
/** @inheritdoc */

src/display/editor/outliner.js

-2
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,6 @@ class FreeHighlightOutline extends Outline {
837837
y = minY - this.#innerMargin,
838838
width = maxX - minX + 2 * this.#innerMargin,
839839
height = maxY - minY + 2 * this.#innerMargin;
840-
lastPointX = (lastPointX - x) / width;
841-
lastPointY = (lastPointY - y) / height;
842840
this.#bbox = { x, y, width, height, lastPoint: [lastPointX, lastPointY] };
843841
}
844842

0 commit comments

Comments
 (0)