[Editor] Fix the position of the free highlight toolbar
This commit is contained in:
parent
56dabe9390
commit
7529c1e3dc
@ -138,8 +138,7 @@ class HighlightEditor extends AnnotationEditor {
|
|||||||
this.parent.drawLayer.updateLine(this.#id, highlightOutlines);
|
this.parent.drawLayer.updateLine(this.#id, highlightOutlines);
|
||||||
this.parent.drawLayer.updateLine(this.#outlineId, this.#focusOutlines);
|
this.parent.drawLayer.updateLine(this.#outlineId, this.#focusOutlines);
|
||||||
}
|
}
|
||||||
const { x, y, width, height, lastPoint } = highlightOutlines.box;
|
const { x, y, width, height } = highlightOutlines.box;
|
||||||
this.#lastPoint = lastPoint;
|
|
||||||
switch (this.rotation) {
|
switch (this.rotation) {
|
||||||
case 0:
|
case 0:
|
||||||
this.x = x;
|
this.x = x;
|
||||||
@ -170,6 +169,11 @@ class HighlightEditor extends AnnotationEditor {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const { lastPoint } = this.#focusOutlines.box;
|
||||||
|
this.#lastPoint = [
|
||||||
|
(lastPoint[0] - this.x) / this.width,
|
||||||
|
(lastPoint[1] - this.y) / this.height,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
|
@ -837,8 +837,6 @@ class FreeHighlightOutline extends Outline {
|
|||||||
y = minY - this.#innerMargin,
|
y = minY - this.#innerMargin,
|
||||||
width = maxX - minX + 2 * this.#innerMargin,
|
width = maxX - minX + 2 * this.#innerMargin,
|
||||||
height = maxY - minY + 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] };
|
this.#bbox = { x, y, width, height, lastPoint: [lastPointX, lastPointY] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user