@pooder/kit 5.4.0 → 6.0.1
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/.test-dist/src/coordinate.js +74 -0
- package/.test-dist/src/extensions/background.js +547 -0
- package/.test-dist/src/extensions/bridgeSelection.js +20 -0
- package/.test-dist/src/extensions/constraints.js +237 -0
- package/.test-dist/src/extensions/dieline.js +935 -0
- package/.test-dist/src/extensions/dielineShape.js +66 -0
- package/.test-dist/src/extensions/edgeScale.js +12 -0
- package/.test-dist/src/extensions/feature.js +910 -0
- package/.test-dist/src/extensions/featureComplete.js +32 -0
- package/.test-dist/src/extensions/film.js +226 -0
- package/.test-dist/src/extensions/geometry.js +609 -0
- package/.test-dist/src/extensions/image.js +1788 -0
- package/.test-dist/src/extensions/index.js +28 -0
- package/.test-dist/src/extensions/maskOps.js +334 -0
- package/.test-dist/src/extensions/mirror.js +104 -0
- package/.test-dist/src/extensions/ruler.js +442 -0
- package/.test-dist/src/extensions/sceneLayout.js +96 -0
- package/.test-dist/src/extensions/sceneLayoutModel.js +202 -0
- package/.test-dist/src/extensions/sceneVisibility.js +55 -0
- package/.test-dist/src/extensions/size.js +331 -0
- package/.test-dist/src/extensions/tracer.js +709 -0
- package/.test-dist/src/extensions/white-ink.js +1200 -0
- package/.test-dist/src/extensions/wrappedOffsets.js +33 -0
- package/.test-dist/src/index.js +18 -0
- package/.test-dist/src/services/CanvasService.js +1032 -0
- package/.test-dist/src/services/ViewportSystem.js +76 -0
- package/.test-dist/src/services/index.js +25 -0
- package/.test-dist/src/services/renderSpec.js +2 -0
- package/.test-dist/src/services/visibility.js +57 -0
- package/.test-dist/src/units.js +30 -0
- package/.test-dist/tests/run.js +150 -0
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +164 -62
- package/dist/index.d.ts +164 -62
- package/dist/index.js +2433 -1719
- package/dist/index.mjs +2442 -1723
- package/package.json +1 -1
- package/src/coordinate.ts +106 -106
- package/src/extensions/background.ts +716 -323
- package/src/extensions/bridgeSelection.ts +17 -17
- package/src/extensions/constraints.ts +322 -322
- package/src/extensions/dieline.ts +1173 -1149
- package/src/extensions/dielineShape.ts +109 -109
- package/src/extensions/edgeScale.ts +19 -19
- package/src/extensions/feature.ts +1140 -1137
- package/src/extensions/featureComplete.ts +46 -46
- package/src/extensions/film.ts +270 -266
- package/src/extensions/geometry.ts +851 -885
- package/src/extensions/image.ts +2240 -2054
- package/src/extensions/index.ts +10 -11
- package/src/extensions/maskOps.ts +283 -283
- package/src/extensions/mirror.ts +128 -128
- package/src/extensions/ruler.ts +664 -654
- package/src/extensions/sceneLayout.ts +140 -140
- package/src/extensions/sceneLayoutModel.ts +364 -364
- package/src/extensions/size.ts +389 -389
- package/src/extensions/tracer.ts +1019 -1019
- package/src/extensions/white-ink.ts +1508 -1575
- package/src/extensions/wrappedOffsets.ts +33 -33
- package/src/index.ts +2 -2
- package/src/services/CanvasService.ts +1317 -832
- package/src/services/ViewportSystem.ts +95 -95
- package/src/services/index.ts +4 -3
- package/src/services/renderSpec.ts +85 -53
- package/src/services/visibility.ts +83 -0
- package/src/units.ts +27 -27
- package/tests/run.ts +258 -118
- package/tsconfig.test.json +15 -15
- package/src/extensions/sceneVisibility.ts +0 -64
package/tests/run.ts
CHANGED
|
@@ -1,118 +1,258 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]);
|
|
49
|
-
assert(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
import {
|
|
2
|
+
pickExitIndex,
|
|
3
|
+
scoreOutsideAbove,
|
|
4
|
+
} from "../src/extensions/bridgeSelection";
|
|
5
|
+
import {
|
|
6
|
+
sampleWrappedOffsets,
|
|
7
|
+
wrappedDistance,
|
|
8
|
+
} from "../src/extensions/wrappedOffsets";
|
|
9
|
+
import {
|
|
10
|
+
circularMorphology,
|
|
11
|
+
createMask,
|
|
12
|
+
fillHoles,
|
|
13
|
+
findMinimalConnectRadius,
|
|
14
|
+
isMaskConnected8,
|
|
15
|
+
} from "../src/extensions/maskOps";
|
|
16
|
+
import { computeDetectEdgeSize } from "../src/extensions/edgeScale";
|
|
17
|
+
import { evaluateVisibilityExpr } from "../src/services/visibility";
|
|
18
|
+
|
|
19
|
+
function assert(condition: unknown, message: string) {
|
|
20
|
+
if (!condition) throw new Error(message);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function testWrappedOffsets() {
|
|
24
|
+
assert(wrappedDistance(100, 10, 30) === 20, "distance 10->30 should be 20");
|
|
25
|
+
assert(wrappedDistance(100, 90, 10) === 20, "distance 90->10 should wrap to 20");
|
|
26
|
+
|
|
27
|
+
const a = sampleWrappedOffsets(100, 10, 30, 5);
|
|
28
|
+
assert(
|
|
29
|
+
JSON.stringify(a) === JSON.stringify([10, 15, 20, 25, 30]),
|
|
30
|
+
`unexpected sample: ${JSON.stringify(a)}`,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const b = sampleWrappedOffsets(100, 90, 10, 3);
|
|
34
|
+
assert(
|
|
35
|
+
JSON.stringify(b) === JSON.stringify([90, 0, 10]),
|
|
36
|
+
`unexpected wrap sample: ${JSON.stringify(b)}`,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function testBridgeSelection() {
|
|
41
|
+
const idx = pickExitIndex([
|
|
42
|
+
{ insideAbove: true, insideBelow: true },
|
|
43
|
+
{ insideAbove: false, insideBelow: true },
|
|
44
|
+
{ insideAbove: false, insideBelow: false },
|
|
45
|
+
]);
|
|
46
|
+
assert(idx === 1, `expected exit index 1, got ${idx}`);
|
|
47
|
+
|
|
48
|
+
const none = pickExitIndex([{ insideAbove: true, insideBelow: true }]);
|
|
49
|
+
assert(none === -1, `expected -1, got ${none}`);
|
|
50
|
+
|
|
51
|
+
const score = scoreOutsideAbove([
|
|
52
|
+
{ outsideAbove: true },
|
|
53
|
+
{ outsideAbove: false },
|
|
54
|
+
{ outsideAbove: true },
|
|
55
|
+
]);
|
|
56
|
+
assert(score === 2, `expected score 2, got ${score}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function testMaskOps() {
|
|
60
|
+
const width = 50;
|
|
61
|
+
const height = 50;
|
|
62
|
+
const mask = new Uint8Array(width * height);
|
|
63
|
+
mask[10 * width + 10] = 1;
|
|
64
|
+
mask[10 * width + 20] = 1;
|
|
65
|
+
|
|
66
|
+
const r = findMinimalConnectRadius(mask, width, height, 20);
|
|
67
|
+
const closed = circularMorphology(mask, width, height, r, "closing");
|
|
68
|
+
assert(isMaskConnected8(closed, width, height), `closed mask should be connected (r=${r})`);
|
|
69
|
+
if (r > 0) {
|
|
70
|
+
const closedPrev = circularMorphology(mask, width, height, r - 1, "closing");
|
|
71
|
+
assert(
|
|
72
|
+
!isMaskConnected8(closedPrev, width, height),
|
|
73
|
+
`r should be minimal (r=${r})`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const donut = new Uint8Array(9 * 9);
|
|
78
|
+
for (let y = 1; y <= 7; y++) {
|
|
79
|
+
for (let x = 1; x <= 7; x++) donut[y * 9 + x] = 1;
|
|
80
|
+
}
|
|
81
|
+
for (let y = 3; y <= 5; y++) {
|
|
82
|
+
for (let x = 3; x <= 5; x++) donut[y * 9 + x] = 0;
|
|
83
|
+
}
|
|
84
|
+
const filled = fillHoles(donut, 9, 9);
|
|
85
|
+
assert(filled[4 * 9 + 4] === 1, "hole should be filled");
|
|
86
|
+
|
|
87
|
+
const imgW = 2;
|
|
88
|
+
const imgH = 1;
|
|
89
|
+
const rgba = new Uint8ClampedArray([
|
|
90
|
+
255, 255, 255, 255, 10, 10, 10, 254,
|
|
91
|
+
]);
|
|
92
|
+
const imageData = { width: imgW, height: imgH, data: rgba } as unknown as ImageData;
|
|
93
|
+
const paddedWidth = imgW + 4;
|
|
94
|
+
const paddedHeight = imgH + 4;
|
|
95
|
+
const created = createMask(imageData, {
|
|
96
|
+
threshold: 10,
|
|
97
|
+
padding: 2,
|
|
98
|
+
paddedWidth,
|
|
99
|
+
paddedHeight,
|
|
100
|
+
maskMode: "auto",
|
|
101
|
+
alphaOpaqueCutoff: 250,
|
|
102
|
+
});
|
|
103
|
+
assert(created[2 * paddedWidth + 2] === 0, "white pixel should be background");
|
|
104
|
+
assert(created[2 * paddedWidth + 3] === 1, "non-white pixel should be foreground");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function testEdgeScale() {
|
|
108
|
+
const currentMax = 100;
|
|
109
|
+
const baseBounds = { width: 50, height: 20 };
|
|
110
|
+
const expandedBounds = { width: 70, height: 40 };
|
|
111
|
+
const { width, height, scale } = computeDetectEdgeSize(currentMax, baseBounds, expandedBounds);
|
|
112
|
+
assert(scale === 2, `expected scale 2, got ${scale}`);
|
|
113
|
+
assert(width === 140, `expected width 140, got ${width}`);
|
|
114
|
+
assert(height === 80, `expected height 80, got ${height}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function testVisibilityDsl() {
|
|
118
|
+
const layers = new Map([
|
|
119
|
+
["ruler-overlay", { exists: true, objectCount: 2 }],
|
|
120
|
+
["feature-overlay", { exists: true, objectCount: 0 }],
|
|
121
|
+
]);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
activeToolId: "pooder.kit.image",
|
|
125
|
+
isSessionActive: (toolId: string) => toolId === "pooder.kit.feature",
|
|
126
|
+
hasAnyActiveSession: () => true,
|
|
127
|
+
layers,
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
assert(
|
|
131
|
+
evaluateVisibilityExpr({ op: "const", value: true }, context) === true,
|
|
132
|
+
"const true failed",
|
|
133
|
+
);
|
|
134
|
+
assert(
|
|
135
|
+
evaluateVisibilityExpr({ op: "const", value: false }, context) === false,
|
|
136
|
+
"const false failed",
|
|
137
|
+
);
|
|
138
|
+
assert(
|
|
139
|
+
evaluateVisibilityExpr(
|
|
140
|
+
{ op: "activeToolIn", ids: ["pooder.kit.image"] },
|
|
141
|
+
context,
|
|
142
|
+
) === true,
|
|
143
|
+
"activeToolIn true failed",
|
|
144
|
+
);
|
|
145
|
+
assert(
|
|
146
|
+
evaluateVisibilityExpr(
|
|
147
|
+
{ op: "activeToolIn", ids: ["pooder.kit.white-ink"] },
|
|
148
|
+
context,
|
|
149
|
+
) === false,
|
|
150
|
+
"activeToolIn false failed",
|
|
151
|
+
);
|
|
152
|
+
assert(
|
|
153
|
+
evaluateVisibilityExpr(
|
|
154
|
+
{ op: "sessionActive", toolId: "pooder.kit.feature" },
|
|
155
|
+
context,
|
|
156
|
+
) === true,
|
|
157
|
+
"sessionActive true failed",
|
|
158
|
+
);
|
|
159
|
+
assert(
|
|
160
|
+
evaluateVisibilityExpr(
|
|
161
|
+
{ op: "sessionActive", toolId: "pooder.kit.ruler" },
|
|
162
|
+
context,
|
|
163
|
+
) === false,
|
|
164
|
+
"sessionActive false failed",
|
|
165
|
+
);
|
|
166
|
+
assert(
|
|
167
|
+
evaluateVisibilityExpr({ op: "anySessionActive" }, context) === true,
|
|
168
|
+
"anySessionActive true failed",
|
|
169
|
+
);
|
|
170
|
+
assert(
|
|
171
|
+
evaluateVisibilityExpr(
|
|
172
|
+
{ op: "layerExists", layerId: "ruler-overlay" },
|
|
173
|
+
context,
|
|
174
|
+
) === true,
|
|
175
|
+
"layerExists true failed",
|
|
176
|
+
);
|
|
177
|
+
assert(
|
|
178
|
+
evaluateVisibilityExpr(
|
|
179
|
+
{ op: "layerExists", layerId: "missing-layer" },
|
|
180
|
+
context,
|
|
181
|
+
) === false,
|
|
182
|
+
"layerExists false failed",
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
const comparisons: Array<{
|
|
186
|
+
cmp: ">" | ">=" | "==" | "<" | "<=";
|
|
187
|
+
value: number;
|
|
188
|
+
expected: boolean;
|
|
189
|
+
}> = [
|
|
190
|
+
{ cmp: ">", value: 1, expected: true },
|
|
191
|
+
{ cmp: ">=", value: 2, expected: true },
|
|
192
|
+
{ cmp: "==", value: 2, expected: true },
|
|
193
|
+
{ cmp: "<", value: 2, expected: false },
|
|
194
|
+
{ cmp: "<=", value: 1, expected: false },
|
|
195
|
+
];
|
|
196
|
+
comparisons.forEach((entry) => {
|
|
197
|
+
assert(
|
|
198
|
+
evaluateVisibilityExpr(
|
|
199
|
+
{
|
|
200
|
+
op: "layerObjectCount",
|
|
201
|
+
layerId: "ruler-overlay",
|
|
202
|
+
cmp: entry.cmp,
|
|
203
|
+
value: entry.value,
|
|
204
|
+
},
|
|
205
|
+
context,
|
|
206
|
+
) === entry.expected,
|
|
207
|
+
`layerObjectCount ${entry.cmp} failed`,
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
assert(
|
|
212
|
+
evaluateVisibilityExpr(
|
|
213
|
+
{
|
|
214
|
+
op: "not",
|
|
215
|
+
expr: { op: "activeToolIn", ids: ["pooder.kit.white-ink"] },
|
|
216
|
+
},
|
|
217
|
+
context,
|
|
218
|
+
) === true,
|
|
219
|
+
"not failed",
|
|
220
|
+
);
|
|
221
|
+
assert(
|
|
222
|
+
evaluateVisibilityExpr(
|
|
223
|
+
{
|
|
224
|
+
op: "all",
|
|
225
|
+
exprs: [
|
|
226
|
+
{ op: "layerExists", layerId: "ruler-overlay" },
|
|
227
|
+
{ op: "sessionActive", toolId: "pooder.kit.feature" },
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
context,
|
|
231
|
+
) === true,
|
|
232
|
+
"all failed",
|
|
233
|
+
);
|
|
234
|
+
assert(
|
|
235
|
+
evaluateVisibilityExpr(
|
|
236
|
+
{
|
|
237
|
+
op: "any",
|
|
238
|
+
exprs: [
|
|
239
|
+
{ op: "layerExists", layerId: "missing-layer" },
|
|
240
|
+
{ op: "activeToolIn", ids: ["pooder.kit.image"] },
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
context,
|
|
244
|
+
) === true,
|
|
245
|
+
"any failed",
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function main() {
|
|
250
|
+
testWrappedOffsets();
|
|
251
|
+
testBridgeSelection();
|
|
252
|
+
testMaskOps();
|
|
253
|
+
testEdgeScale();
|
|
254
|
+
testVisibilityDsl();
|
|
255
|
+
console.log("ok");
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
main();
|
package/tsconfig.test.json
CHANGED
|
@@ -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
|
+
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Service, ServiceContext, WORKBENCH_SERVICE } from "@pooder/core";
|
|
2
|
-
import { CanvasService } from "../services";
|
|
3
|
-
|
|
4
|
-
const CANVAS_SERVICE_ID = "CanvasService";
|
|
5
|
-
const HIDDEN_DIELINE_TOOLS = new Set(["pooder.kit.image", "pooder.kit.white-ink"]);
|
|
6
|
-
const HIDDEN_RULER_TOOLS = new Set(["pooder.kit.white-ink"]);
|
|
7
|
-
|
|
8
|
-
export class SceneVisibilityService implements Service {
|
|
9
|
-
private context?: ServiceContext;
|
|
10
|
-
private activeToolId: string | null = null;
|
|
11
|
-
private canvasService?: CanvasService;
|
|
12
|
-
|
|
13
|
-
init(context: ServiceContext) {
|
|
14
|
-
if (this.context) {
|
|
15
|
-
this.dispose(this.context);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const canvasService =
|
|
19
|
-
context.get<CanvasService>(CANVAS_SERVICE_ID);
|
|
20
|
-
if (!canvasService) {
|
|
21
|
-
throw new Error("[SceneVisibilityService] CanvasService is required.");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
this.context = context;
|
|
25
|
-
this.canvasService = canvasService;
|
|
26
|
-
this.activeToolId = context.get(WORKBENCH_SERVICE)?.activeToolId ?? null;
|
|
27
|
-
context.eventBus.on("tool:activated", this.onToolActivated);
|
|
28
|
-
context.eventBus.on("object:added", this.onObjectAdded);
|
|
29
|
-
this.apply();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
dispose(context: ServiceContext) {
|
|
33
|
-
const activeContext = this.context ?? context;
|
|
34
|
-
activeContext.eventBus.off("tool:activated", this.onToolActivated);
|
|
35
|
-
activeContext.eventBus.off("object:added", this.onObjectAdded);
|
|
36
|
-
this.context = undefined;
|
|
37
|
-
this.activeToolId = null;
|
|
38
|
-
this.canvasService = undefined;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
private onToolActivated = (e: { id: string | null }) => {
|
|
42
|
-
this.activeToolId = e.id;
|
|
43
|
-
this.apply();
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
private onObjectAdded = () => {
|
|
47
|
-
this.apply();
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
private apply() {
|
|
51
|
-
if (!this.canvasService) return;
|
|
52
|
-
|
|
53
|
-
const dielineLayer = this.canvasService.getLayer("dieline-overlay");
|
|
54
|
-
if (dielineLayer) {
|
|
55
|
-
const visible = !HIDDEN_DIELINE_TOOLS.has(this.activeToolId || "");
|
|
56
|
-
this.canvasService.setLayerVisibility("dieline-overlay", visible);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const rulerVisible = !HIDDEN_RULER_TOOLS.has(this.activeToolId || "");
|
|
60
|
-
this.canvasService.setLayerVisibility("ruler-overlay", rulerVisible);
|
|
61
|
-
|
|
62
|
-
this.canvasService.requestRenderAll();
|
|
63
|
-
}
|
|
64
|
-
}
|