mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-10 11:10:55 +08:00
Fix Bezier-rs interactive demos and migrate its Webpack bundler to Vite
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { WasmBezier } from "@/../wasm/pkg";
|
||||
import bezierFeatures, { BezierFeatureKey } from "@/features/bezier-features";
|
||||
import type { BezierFeatureKey } from "@/features/bezier-features";
|
||||
import bezierFeatures from "@/features/bezier-features";
|
||||
import { renderDemo } from "@/utils/render";
|
||||
import { getConstructorKey, getCurveType, BezierCallback, BezierCurveType, InputOption, WasmBezierManipulatorKey, Demo } from "@/utils/types";
|
||||
import type { BezierCallback, BezierCurveType, InputOption, WasmBezierManipulatorKey, Demo } from "@/utils/types";
|
||||
import { getConstructorKey, getCurveType } from "@/utils/types";
|
||||
|
||||
const SELECTABLE_RANGE = 10;
|
||||
|
||||
@@ -54,8 +56,7 @@ class BezierDemo extends HTMLElement implements Demo {
|
||||
this.render();
|
||||
|
||||
const figure = this.querySelector("figure") as HTMLElement;
|
||||
const wasm = await import("@/../wasm/pkg");
|
||||
this.bezier = wasm.WasmBezier[getConstructorKey(curveType)](this.points);
|
||||
this.bezier = WasmBezier[getConstructorKey(curveType)](this.points);
|
||||
this.drawDemo(figure);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user