@pooder/kit 5.2.0 → 5.3.0

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.
Files changed (86) hide show
  1. package/.test-dist/src/CanvasService.js +249 -249
  2. package/.test-dist/src/ViewportSystem.js +75 -75
  3. package/.test-dist/src/background.js +203 -203
  4. package/.test-dist/src/bridgeSelection.js +20 -20
  5. package/.test-dist/src/constraints.js +237 -237
  6. package/.test-dist/src/dieline.js +818 -818
  7. package/.test-dist/src/edgeScale.js +12 -12
  8. package/.test-dist/src/extensions/background.js +203 -0
  9. package/.test-dist/src/extensions/bridgeSelection.js +20 -0
  10. package/.test-dist/src/extensions/constraints.js +237 -0
  11. package/.test-dist/src/extensions/dieline.js +828 -0
  12. package/.test-dist/src/extensions/edgeScale.js +12 -0
  13. package/.test-dist/src/extensions/feature.js +825 -0
  14. package/.test-dist/src/extensions/featureComplete.js +32 -0
  15. package/.test-dist/src/extensions/film.js +167 -0
  16. package/.test-dist/src/extensions/geometry.js +545 -0
  17. package/.test-dist/src/extensions/image.js +1529 -0
  18. package/.test-dist/src/extensions/index.js +30 -0
  19. package/.test-dist/src/extensions/maskOps.js +279 -0
  20. package/.test-dist/src/extensions/mirror.js +104 -0
  21. package/.test-dist/src/extensions/ruler.js +345 -0
  22. package/.test-dist/src/extensions/sceneLayout.js +96 -0
  23. package/.test-dist/src/extensions/sceneLayoutModel.js +196 -0
  24. package/.test-dist/src/extensions/sceneVisibility.js +62 -0
  25. package/.test-dist/src/extensions/size.js +331 -0
  26. package/.test-dist/src/extensions/tracer.js +538 -0
  27. package/.test-dist/src/extensions/white-ink.js +1190 -0
  28. package/.test-dist/src/extensions/wrappedOffsets.js +33 -0
  29. package/.test-dist/src/feature.js +826 -826
  30. package/.test-dist/src/featureComplete.js +32 -32
  31. package/.test-dist/src/film.js +167 -167
  32. package/.test-dist/src/geometry.js +506 -506
  33. package/.test-dist/src/image.js +1250 -1250
  34. package/.test-dist/src/index.js +2 -19
  35. package/.test-dist/src/maskOps.js +270 -270
  36. package/.test-dist/src/mirror.js +104 -104
  37. package/.test-dist/src/renderSpec.js +2 -2
  38. package/.test-dist/src/ruler.js +343 -343
  39. package/.test-dist/src/sceneLayout.js +99 -99
  40. package/.test-dist/src/sceneLayoutModel.js +196 -196
  41. package/.test-dist/src/sceneView.js +40 -40
  42. package/.test-dist/src/sceneVisibility.js +42 -42
  43. package/.test-dist/src/services/CanvasService.js +249 -0
  44. package/.test-dist/src/services/ViewportSystem.js +76 -0
  45. package/.test-dist/src/services/index.js +24 -0
  46. package/.test-dist/src/services/renderSpec.js +2 -0
  47. package/.test-dist/src/size.js +332 -332
  48. package/.test-dist/src/tracer.js +544 -544
  49. package/.test-dist/src/white-ink.js +829 -829
  50. package/.test-dist/src/wrappedOffsets.js +33 -33
  51. package/CHANGELOG.md +6 -0
  52. package/dist/index.d.mts +5 -0
  53. package/dist/index.d.ts +5 -0
  54. package/dist/index.js +411 -375
  55. package/dist/index.mjs +411 -375
  56. package/package.json +1 -1
  57. package/src/coordinate.ts +106 -106
  58. package/src/extensions/background.ts +230 -230
  59. package/src/extensions/bridgeSelection.ts +17 -17
  60. package/src/extensions/constraints.ts +322 -322
  61. package/src/extensions/dieline.ts +20 -17
  62. package/src/extensions/edgeScale.ts +19 -19
  63. package/src/extensions/feature.ts +1021 -1021
  64. package/src/extensions/featureComplete.ts +46 -46
  65. package/src/extensions/film.ts +194 -194
  66. package/src/extensions/geometry.ts +719 -719
  67. package/src/extensions/image.ts +1924 -1924
  68. package/src/extensions/index.ts +11 -11
  69. package/src/extensions/maskOps.ts +365 -299
  70. package/src/extensions/mirror.ts +128 -128
  71. package/src/extensions/ruler.ts +451 -451
  72. package/src/extensions/sceneLayout.ts +140 -140
  73. package/src/extensions/sceneLayoutModel.ts +342 -342
  74. package/src/extensions/sceneVisibility.ts +71 -71
  75. package/src/extensions/size.ts +389 -389
  76. package/src/extensions/tracer.ts +302 -370
  77. package/src/extensions/white-ink.ts +1489 -1366
  78. package/src/extensions/wrappedOffsets.ts +33 -33
  79. package/src/index.ts +2 -2
  80. package/src/services/CanvasService.ts +300 -300
  81. package/src/services/ViewportSystem.ts +95 -95
  82. package/src/services/index.ts +3 -3
  83. package/src/services/renderSpec.ts +18 -18
  84. package/src/units.ts +27 -27
  85. package/tests/run.ts +118 -118
  86. package/tsconfig.test.json +15 -15
@@ -1,95 +1,95 @@
1
- import { Coordinate, Layout, Point, Size } from "../coordinate";
2
-
3
- export class ViewportSystem {
4
- private _containerSize: Size = { width: 0, height: 0 };
5
- private _physicalSize: Size = { width: 0, height: 0 };
6
- private _padding: number = 0;
7
- private _layout: Layout = {
8
- scale: 1,
9
- offsetX: 0,
10
- offsetY: 0,
11
- width: 0,
12
- height: 0,
13
- };
14
-
15
- constructor(
16
- containerSize: Size = { width: 0, height: 0 },
17
- physicalSize: Size = { width: 0, height: 0 },
18
- padding: number = 40,
19
- ) {
20
- this._containerSize = containerSize;
21
- this._physicalSize = physicalSize;
22
- this._padding = padding;
23
- this.updateLayout();
24
- }
25
-
26
- get layout(): Layout {
27
- return this._layout;
28
- }
29
-
30
- get scale(): number {
31
- return this._layout.scale;
32
- }
33
-
34
- get offset(): Point {
35
- return { x: this._layout.offsetX, y: this._layout.offsetY };
36
- }
37
-
38
- updateContainer(width: number, height: number) {
39
- if (
40
- this._containerSize.width === width &&
41
- this._containerSize.height === height
42
- )
43
- return;
44
- this._containerSize = { width, height };
45
- this.updateLayout();
46
- }
47
-
48
- updatePhysical(width: number, height: number) {
49
- if (
50
- this._physicalSize.width === width &&
51
- this._physicalSize.height === height
52
- )
53
- return;
54
- this._physicalSize = { width, height };
55
- this.updateLayout();
56
- }
57
-
58
- setPadding(padding: number) {
59
- if (this._padding === padding) return;
60
- this._padding = padding;
61
- this.updateLayout();
62
- }
63
-
64
- private updateLayout() {
65
- this._layout = Coordinate.calculateLayout(
66
- this._containerSize,
67
- this._physicalSize,
68
- this._padding,
69
- );
70
- }
71
-
72
- toPixel(value: number): number {
73
- return value * this._layout.scale;
74
- }
75
-
76
- toPhysical(value: number): number {
77
- return this._layout.scale === 0 ? 0 : value / this._layout.scale;
78
- }
79
-
80
- toPixelPoint(point: Point): Point {
81
- return {
82
- x: point.x * this._layout.scale + this._layout.offsetX,
83
- y: point.y * this._layout.scale + this._layout.offsetY,
84
- };
85
- }
86
-
87
- // Convert screen coordinate (e.g. mouse event) to physical coordinate (relative to content origin)
88
- toPhysicalPoint(point: Point): Point {
89
- if (this._layout.scale === 0) return { x: 0, y: 0 };
90
- return {
91
- x: (point.x - this._layout.offsetX) / this._layout.scale,
92
- y: (point.y - this._layout.offsetY) / this._layout.scale,
93
- };
94
- }
95
- }
1
+ import { Coordinate, Layout, Point, Size } from "../coordinate";
2
+
3
+ export class ViewportSystem {
4
+ private _containerSize: Size = { width: 0, height: 0 };
5
+ private _physicalSize: Size = { width: 0, height: 0 };
6
+ private _padding: number = 0;
7
+ private _layout: Layout = {
8
+ scale: 1,
9
+ offsetX: 0,
10
+ offsetY: 0,
11
+ width: 0,
12
+ height: 0,
13
+ };
14
+
15
+ constructor(
16
+ containerSize: Size = { width: 0, height: 0 },
17
+ physicalSize: Size = { width: 0, height: 0 },
18
+ padding: number = 40,
19
+ ) {
20
+ this._containerSize = containerSize;
21
+ this._physicalSize = physicalSize;
22
+ this._padding = padding;
23
+ this.updateLayout();
24
+ }
25
+
26
+ get layout(): Layout {
27
+ return this._layout;
28
+ }
29
+
30
+ get scale(): number {
31
+ return this._layout.scale;
32
+ }
33
+
34
+ get offset(): Point {
35
+ return { x: this._layout.offsetX, y: this._layout.offsetY };
36
+ }
37
+
38
+ updateContainer(width: number, height: number) {
39
+ if (
40
+ this._containerSize.width === width &&
41
+ this._containerSize.height === height
42
+ )
43
+ return;
44
+ this._containerSize = { width, height };
45
+ this.updateLayout();
46
+ }
47
+
48
+ updatePhysical(width: number, height: number) {
49
+ if (
50
+ this._physicalSize.width === width &&
51
+ this._physicalSize.height === height
52
+ )
53
+ return;
54
+ this._physicalSize = { width, height };
55
+ this.updateLayout();
56
+ }
57
+
58
+ setPadding(padding: number) {
59
+ if (this._padding === padding) return;
60
+ this._padding = padding;
61
+ this.updateLayout();
62
+ }
63
+
64
+ private updateLayout() {
65
+ this._layout = Coordinate.calculateLayout(
66
+ this._containerSize,
67
+ this._physicalSize,
68
+ this._padding,
69
+ );
70
+ }
71
+
72
+ toPixel(value: number): number {
73
+ return value * this._layout.scale;
74
+ }
75
+
76
+ toPhysical(value: number): number {
77
+ return this._layout.scale === 0 ? 0 : value / this._layout.scale;
78
+ }
79
+
80
+ toPixelPoint(point: Point): Point {
81
+ return {
82
+ x: point.x * this._layout.scale + this._layout.offsetX,
83
+ y: point.y * this._layout.scale + this._layout.offsetY,
84
+ };
85
+ }
86
+
87
+ // Convert screen coordinate (e.g. mouse event) to physical coordinate (relative to content origin)
88
+ toPhysicalPoint(point: Point): Point {
89
+ if (this._layout.scale === 0) return { x: 0, y: 0 };
90
+ return {
91
+ x: (point.x - this._layout.offsetX) / this._layout.scale,
92
+ y: (point.y - this._layout.offsetY) / this._layout.scale,
93
+ };
94
+ }
95
+ }
@@ -1,3 +1,3 @@
1
- export { default as CanvasService } from "./CanvasService";
2
- export * from "./renderSpec";
3
- export * from "./ViewportSystem";
1
+ export { default as CanvasService } from "./CanvasService";
2
+ export * from "./renderSpec";
3
+ export * from "./ViewportSystem";
@@ -1,18 +1,18 @@
1
- export type RenderObjectType = "rect" | "image" | "path";
2
-
3
- export type RenderProps = Record<string, any>;
4
-
5
- export interface RenderObjectSpec {
6
- id: string;
7
- type: RenderObjectType;
8
- props: RenderProps;
9
- data?: Record<string, any>;
10
- src?: string;
11
- }
12
-
13
- export interface RenderLayerSpec {
14
- id: string;
15
- objects: RenderObjectSpec[];
16
- props?: RenderProps;
17
- }
18
-
1
+ export type RenderObjectType = "rect" | "image" | "path";
2
+
3
+ export type RenderProps = Record<string, any>;
4
+
5
+ export interface RenderObjectSpec {
6
+ id: string;
7
+ type: RenderObjectType;
8
+ props: RenderProps;
9
+ data?: Record<string, any>;
10
+ src?: string;
11
+ }
12
+
13
+ export interface RenderLayerSpec {
14
+ id: string;
15
+ objects: RenderObjectSpec[];
16
+ props?: RenderProps;
17
+ }
18
+
package/src/units.ts CHANGED
@@ -1,27 +1,27 @@
1
- import { Coordinate, Unit } from "./coordinate";
2
-
3
- export function parseLengthToMm(input: number | string, defaultUnit: Unit): number {
4
- if (typeof input === "number") {
5
- if (!Number.isFinite(input)) return 0;
6
- return Coordinate.convertUnit(input, defaultUnit, "mm");
7
- }
8
-
9
- const raw = input.trim();
10
- if (!raw) return 0;
11
-
12
- const match = raw.match(/^([+-]?\d+(?:\.\d+)?)\s*(px|mm|cm|in)?$/i);
13
- if (!match) return 0;
14
-
15
- const value = Number(match[1]);
16
- if (!Number.isFinite(value)) return 0;
17
-
18
- const unit = (match[2]?.toLowerCase() as Unit | undefined) ?? defaultUnit;
19
- return Coordinate.convertUnit(value, unit, "mm");
20
- }
21
-
22
- export function formatMm(valueMm: number, displayUnit: Unit, fractionDigits: number = 2): string {
23
- if (!Number.isFinite(valueMm)) return "0";
24
- const value = Coordinate.convertUnit(valueMm, "mm", displayUnit);
25
- const rounded = Number(value.toFixed(fractionDigits));
26
- return rounded.toString();
27
- }
1
+ import { Coordinate, Unit } from "./coordinate";
2
+
3
+ export function parseLengthToMm(input: number | string, defaultUnit: Unit): number {
4
+ if (typeof input === "number") {
5
+ if (!Number.isFinite(input)) return 0;
6
+ return Coordinate.convertUnit(input, defaultUnit, "mm");
7
+ }
8
+
9
+ const raw = input.trim();
10
+ if (!raw) return 0;
11
+
12
+ const match = raw.match(/^([+-]?\d+(?:\.\d+)?)\s*(px|mm|cm|in)?$/i);
13
+ if (!match) return 0;
14
+
15
+ const value = Number(match[1]);
16
+ if (!Number.isFinite(value)) return 0;
17
+
18
+ const unit = (match[2]?.toLowerCase() as Unit | undefined) ?? defaultUnit;
19
+ return Coordinate.convertUnit(value, unit, "mm");
20
+ }
21
+
22
+ export function formatMm(valueMm: number, displayUnit: Unit, fractionDigits: number = 2): string {
23
+ if (!Number.isFinite(valueMm)) return "0";
24
+ const value = Coordinate.convertUnit(valueMm, "mm", displayUnit);
25
+ const rounded = Number(value.toFixed(fractionDigits));
26
+ return rounded.toString();
27
+ }
package/tests/run.ts CHANGED
@@ -1,118 +1,118 @@
1
- import { pickExitIndex, scoreOutsideAbove } from "../src/bridgeSelection";
2
- import { sampleWrappedOffsets, wrappedDistance } from "../src/wrappedOffsets";
3
- import {
4
- circularMorphology,
5
- createMask,
6
- fillHoles,
7
- findMinimalConnectRadius,
8
- isMaskConnected8,
9
- } from "../src/maskOps";
10
- import { computeDetectEdgeSize } from "../src/edgeScale";
11
-
12
- function assert(condition: unknown, message: string) {
13
- if (!condition) throw new Error(message);
14
- }
15
-
16
- function testWrappedOffsets() {
17
- assert(wrappedDistance(100, 10, 30) === 20, "distance 10->30 should be 20");
18
- assert(wrappedDistance(100, 90, 10) === 20, "distance 90->10 should wrap to 20");
19
-
20
- const a = sampleWrappedOffsets(100, 10, 30, 5);
21
- assert(
22
- JSON.stringify(a) === JSON.stringify([10, 15, 20, 25, 30]),
23
- `unexpected sample: ${JSON.stringify(a)}`,
24
- );
25
-
26
- const b = sampleWrappedOffsets(100, 90, 10, 3);
27
- assert(
28
- JSON.stringify(b) === JSON.stringify([90, 0, 10]),
29
- `unexpected wrap sample: ${JSON.stringify(b)}`,
30
- );
31
- }
32
-
33
- function testBridgeSelection() {
34
- const idx = pickExitIndex([
35
- { insideAbove: true, insideBelow: true },
36
- { insideAbove: false, insideBelow: true },
37
- { insideAbove: false, insideBelow: false },
38
- ]);
39
- assert(idx === 1, `expected exit index 1, got ${idx}`);
40
-
41
- const none = pickExitIndex([{ insideAbove: true, insideBelow: true }]);
42
- assert(none === -1, `expected -1, got ${none}`);
43
-
44
- const score = scoreOutsideAbove([
45
- { outsideAbove: true },
46
- { outsideAbove: false },
47
- { outsideAbove: true },
48
- ]);
49
- assert(score === 2, `expected score 2, got ${score}`);
50
- }
51
-
52
- function testMaskOps() {
53
- const width = 50;
54
- const height = 50;
55
- const mask = new Uint8Array(width * height);
56
- mask[10 * width + 10] = 1;
57
- mask[10 * width + 20] = 1;
58
-
59
- const r = findMinimalConnectRadius(mask, width, height, 20);
60
- const closed = circularMorphology(mask, width, height, r, "closing");
61
- assert(isMaskConnected8(closed, width, height), `closed mask should be connected (r=${r})`);
62
- if (r > 0) {
63
- const closedPrev = circularMorphology(mask, width, height, r - 1, "closing");
64
- assert(
65
- !isMaskConnected8(closedPrev, width, height),
66
- `r should be minimal (r=${r})`,
67
- );
68
- }
69
-
70
- const donut = new Uint8Array(9 * 9);
71
- for (let y = 1; y <= 7; y++) {
72
- for (let x = 1; x <= 7; x++) donut[y * 9 + x] = 1;
73
- }
74
- for (let y = 3; y <= 5; y++) {
75
- for (let x = 3; x <= 5; x++) donut[y * 9 + x] = 0;
76
- }
77
- const filled = fillHoles(donut, 9, 9);
78
- assert(filled[4 * 9 + 4] === 1, "hole should be filled");
79
-
80
- const imgW = 2;
81
- const imgH = 1;
82
- const rgba = new Uint8ClampedArray([
83
- 255, 255, 255, 255, 10, 10, 10, 254,
84
- ]);
85
- const imageData = { width: imgW, height: imgH, data: rgba } as unknown as ImageData;
86
- const paddedWidth = imgW + 4;
87
- const paddedHeight = imgH + 4;
88
- const created = createMask(imageData, {
89
- threshold: 10,
90
- padding: 2,
91
- paddedWidth,
92
- paddedHeight,
93
- maskMode: "auto",
94
- alphaOpaqueCutoff: 250,
95
- });
96
- assert(created[2 * paddedWidth + 2] === 0, "white pixel should be background");
97
- assert(created[2 * paddedWidth + 3] === 1, "non-white pixel should be foreground");
98
- }
99
-
100
- function testEdgeScale() {
101
- const currentMax = 100;
102
- const baseBounds = { width: 50, height: 20 };
103
- const expandedBounds = { width: 70, height: 40 };
104
- const { width, height, scale } = computeDetectEdgeSize(currentMax, baseBounds, expandedBounds);
105
- assert(scale === 2, `expected scale 2, got ${scale}`);
106
- assert(width === 140, `expected width 140, got ${width}`);
107
- assert(height === 80, `expected height 80, got ${height}`);
108
- }
109
-
110
- function main() {
111
- testWrappedOffsets();
112
- testBridgeSelection();
113
- testMaskOps();
114
- testEdgeScale();
115
- console.log("ok");
116
- }
117
-
118
- main();
1
+ import { pickExitIndex, scoreOutsideAbove } from "../src/bridgeSelection";
2
+ import { sampleWrappedOffsets, wrappedDistance } from "../src/wrappedOffsets";
3
+ import {
4
+ circularMorphology,
5
+ createMask,
6
+ fillHoles,
7
+ findMinimalConnectRadius,
8
+ isMaskConnected8,
9
+ } from "../src/maskOps";
10
+ import { computeDetectEdgeSize } from "../src/edgeScale";
11
+
12
+ function assert(condition: unknown, message: string) {
13
+ if (!condition) throw new Error(message);
14
+ }
15
+
16
+ function testWrappedOffsets() {
17
+ assert(wrappedDistance(100, 10, 30) === 20, "distance 10->30 should be 20");
18
+ assert(wrappedDistance(100, 90, 10) === 20, "distance 90->10 should wrap to 20");
19
+
20
+ const a = sampleWrappedOffsets(100, 10, 30, 5);
21
+ assert(
22
+ JSON.stringify(a) === JSON.stringify([10, 15, 20, 25, 30]),
23
+ `unexpected sample: ${JSON.stringify(a)}`,
24
+ );
25
+
26
+ const b = sampleWrappedOffsets(100, 90, 10, 3);
27
+ assert(
28
+ JSON.stringify(b) === JSON.stringify([90, 0, 10]),
29
+ `unexpected wrap sample: ${JSON.stringify(b)}`,
30
+ );
31
+ }
32
+
33
+ function testBridgeSelection() {
34
+ const idx = pickExitIndex([
35
+ { insideAbove: true, insideBelow: true },
36
+ { insideAbove: false, insideBelow: true },
37
+ { insideAbove: false, insideBelow: false },
38
+ ]);
39
+ assert(idx === 1, `expected exit index 1, got ${idx}`);
40
+
41
+ const none = pickExitIndex([{ insideAbove: true, insideBelow: true }]);
42
+ assert(none === -1, `expected -1, got ${none}`);
43
+
44
+ const score = scoreOutsideAbove([
45
+ { outsideAbove: true },
46
+ { outsideAbove: false },
47
+ { outsideAbove: true },
48
+ ]);
49
+ assert(score === 2, `expected score 2, got ${score}`);
50
+ }
51
+
52
+ function testMaskOps() {
53
+ const width = 50;
54
+ const height = 50;
55
+ const mask = new Uint8Array(width * height);
56
+ mask[10 * width + 10] = 1;
57
+ mask[10 * width + 20] = 1;
58
+
59
+ const r = findMinimalConnectRadius(mask, width, height, 20);
60
+ const closed = circularMorphology(mask, width, height, r, "closing");
61
+ assert(isMaskConnected8(closed, width, height), `closed mask should be connected (r=${r})`);
62
+ if (r > 0) {
63
+ const closedPrev = circularMorphology(mask, width, height, r - 1, "closing");
64
+ assert(
65
+ !isMaskConnected8(closedPrev, width, height),
66
+ `r should be minimal (r=${r})`,
67
+ );
68
+ }
69
+
70
+ const donut = new Uint8Array(9 * 9);
71
+ for (let y = 1; y <= 7; y++) {
72
+ for (let x = 1; x <= 7; x++) donut[y * 9 + x] = 1;
73
+ }
74
+ for (let y = 3; y <= 5; y++) {
75
+ for (let x = 3; x <= 5; x++) donut[y * 9 + x] = 0;
76
+ }
77
+ const filled = fillHoles(donut, 9, 9);
78
+ assert(filled[4 * 9 + 4] === 1, "hole should be filled");
79
+
80
+ const imgW = 2;
81
+ const imgH = 1;
82
+ const rgba = new Uint8ClampedArray([
83
+ 255, 255, 255, 255, 10, 10, 10, 254,
84
+ ]);
85
+ const imageData = { width: imgW, height: imgH, data: rgba } as unknown as ImageData;
86
+ const paddedWidth = imgW + 4;
87
+ const paddedHeight = imgH + 4;
88
+ const created = createMask(imageData, {
89
+ threshold: 10,
90
+ padding: 2,
91
+ paddedWidth,
92
+ paddedHeight,
93
+ maskMode: "auto",
94
+ alphaOpaqueCutoff: 250,
95
+ });
96
+ assert(created[2 * paddedWidth + 2] === 0, "white pixel should be background");
97
+ assert(created[2 * paddedWidth + 3] === 1, "non-white pixel should be foreground");
98
+ }
99
+
100
+ function testEdgeScale() {
101
+ const currentMax = 100;
102
+ const baseBounds = { width: 50, height: 20 };
103
+ const expandedBounds = { width: 70, height: 40 };
104
+ const { width, height, scale } = computeDetectEdgeSize(currentMax, baseBounds, expandedBounds);
105
+ assert(scale === 2, `expected scale 2, got ${scale}`);
106
+ assert(width === 140, `expected width 140, got ${width}`);
107
+ assert(height === 80, `expected height 80, got ${height}`);
108
+ }
109
+
110
+ function main() {
111
+ testWrappedOffsets();
112
+ testBridgeSelection();
113
+ testMaskOps();
114
+ testEdgeScale();
115
+ console.log("ok");
116
+ }
117
+
118
+ main();
@@ -1,15 +1,15 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "CommonJS",
5
- "lib": ["ES2020", "DOM"],
6
- "moduleResolution": "Node",
7
- "esModuleInterop": true,
8
- "skipLibCheck": true,
9
- "strict": true,
10
- "outDir": ".test-dist",
11
- "rootDir": "."
12
- },
13
- "include": ["tests/**/*.ts", "src/**/*.ts"]
14
- }
15
-
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "CommonJS",
5
+ "lib": ["ES2020", "DOM"],
6
+ "moduleResolution": "Node",
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "outDir": ".test-dist",
11
+ "rootDir": "."
12
+ },
13
+ "include": ["tests/**/*.ts", "src/**/*.ts"]
14
+ }
15
+