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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kviewer",
3
3
  "configKey": "kviewer",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -50,7 +50,19 @@ export class Editor {
50
50
  id,
51
51
  pageNumber,
52
52
  konvaString: konvaGroup.toJSON(),
53
- konvaClientRect: Konva.Node.create(konvaGroup.toJSON()).getClientRect(),
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kviewer",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Kabema PDF Editor",
5
5
  "repository": "kabema/kviewer",
6
6
  "license": "MIT",