goatdee-canvas 0.0.76 → 0.0.77
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/index.cjs +16 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5255,7 +5255,7 @@ const debug = () => {
|
|
|
5255
5255
|
if (typeof window === "undefined") {
|
|
5256
5256
|
return;
|
|
5257
5257
|
}
|
|
5258
|
-
window.__gd = { ...ManagerAPI };
|
|
5258
|
+
window.__gd = { ...window.__gd, ...ManagerAPI };
|
|
5259
5259
|
};
|
|
5260
5260
|
|
|
5261
5261
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -6143,6 +6143,9 @@ const TGFXBind = (module) => {
|
|
|
6143
6143
|
setTGFXModule(module);
|
|
6144
6144
|
module.module = module;
|
|
6145
6145
|
module.ScalerContext = ScalerContext;
|
|
6146
|
+
// tgfx 升级后 WebPathRasterizer.cpp 通过 val::module_property("PathRasterizer") 查找
|
|
6147
|
+
// 这里必须用 PathRasterizer 这个 key 注册;保留 WebMask 作为兼容回退。
|
|
6148
|
+
module.PathRasterizer = PathRasterizer;
|
|
6146
6149
|
module.WebMask = PathRasterizer;
|
|
6147
6150
|
module.Matrix = Matrix;
|
|
6148
6151
|
module.tgfx = { ...tgfx };
|
|
@@ -6161,19 +6164,19 @@ const TGFXBind = (module) => {
|
|
|
6161
6164
|
* 解析出的 URL 通过 emscripten `locateFile` 钩子注入,覆盖默认 sibling 推断。
|
|
6162
6165
|
*/
|
|
6163
6166
|
async function loadWasmModule() {
|
|
6167
|
+
// @ts-ignore - 构建时会被替换为实际值
|
|
6164
6168
|
let wasmModule = null;
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
let infiniteCanvas;
|
|
6169
|
+
let wasmBinaryUrl = null;
|
|
6170
|
+
wasmModule = await Promise.resolve().then(function () { return ZHCanvasCore; });
|
|
6171
|
+
try {
|
|
6172
|
+
wasmBinaryUrl = new URL(
|
|
6173
|
+
"../../wasm/ZHCanvasCore.wasm",
|
|
6174
|
+
(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),
|
|
6175
|
+
).href;
|
|
6176
|
+
} catch (_e) {
|
|
6177
|
+
wasmBinaryUrl = null;
|
|
6178
|
+
}
|
|
6179
|
+
let infiniteCanvas;
|
|
6177
6180
|
try {
|
|
6178
6181
|
infiniteCanvas = manager.getModule();
|
|
6179
6182
|
}
|