mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[Editor] Add validation for the target element of curve endpoints
This patch fixes a bug that caused incorrect curve shapes when an endpoint lies beyond the page boundaries. It adds a check for the endpoint's position, and if it is outside the page, the point is excluded from the shape's coordinates.
This commit is contained in:
parent
79a976ce9d
commit
104e1c3f90
2 changed files with 58 additions and 1 deletions
|
@ -834,7 +834,7 @@ class DrawingEditor extends AnnotationEditor {
|
|||
parent.toggleDrawing(true);
|
||||
this._cleanup(false);
|
||||
|
||||
if (event) {
|
||||
if (event?.target === parent.div) {
|
||||
parent.drawLayer.updateProperties(
|
||||
this._currentDrawId,
|
||||
DrawingEditor.#currentDraw.end(event.offsetX, event.offsetY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue