kviewer 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -50,7 +50,19 @@ export class Editor {
|
|
|
50
50
|
id,
|
|
51
51
|
pageNumber,
|
|
52
52
|
konvaString: konvaGroup.toJSON(),
|
|
53
|
-
|
|
53
|
+
// Do NOT use konvaGroup.getClientRect() directly here — it includes the
|
|
54
|
+
// stage's zoom scale, which would inflate annotation coordinates in the
|
|
55
|
+
// exported PDF. We divide by scale to get page-space coordinates.
|
|
56
|
+
konvaClientRect: (() => {
|
|
57
|
+
const scale = konvaGroup.getStage()?.scaleX() ?? 1;
|
|
58
|
+
const raw = konvaGroup.getClientRect();
|
|
59
|
+
return {
|
|
60
|
+
x: raw.x / scale,
|
|
61
|
+
y: raw.y / scale,
|
|
62
|
+
width: raw.width / scale,
|
|
63
|
+
height: raw.height / scale
|
|
64
|
+
};
|
|
65
|
+
})(),
|
|
54
66
|
title: this.userName,
|
|
55
67
|
type: annotation.type,
|
|
56
68
|
pdfjsType: annotation.pdfjsAnnotationType,
|