Bezier-rs: Remove unused legacy drawing components and structs (#853)

* Removed unused legacy drawing components

* Removed Point abstraction from frontend code

* Code review fixes

* Helper lambdas to functions

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Rob Nadal
2022-11-18 00:34:52 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 2994afa6b8
commit a220bfa759
11 changed files with 47 additions and 660 deletions
@@ -1,6 +1,6 @@
import { BezierCurveType, WasmBezierConstructorKey } from "@/utils/types";
export const getCurveType = (numPoints: number): BezierCurveType => {
export function getCurveType(numPoints: number): BezierCurveType {
switch (numPoints) {
case 2:
return BezierCurveType.Linear;
@@ -11,9 +11,9 @@ export const getCurveType = (numPoints: number): BezierCurveType => {
default:
throw new Error("Invalid number of points for a bezier");
}
};
}
export const getConstructorKey = (bezierCurveType: BezierCurveType): WasmBezierConstructorKey => {
export function getConstructorKey(bezierCurveType: BezierCurveType): WasmBezierConstructorKey {
switch (bezierCurveType) {
case BezierCurveType.Linear:
return "new_linear";
@@ -24,4 +24,4 @@ export const getConstructorKey = (bezierCurveType: BezierCurveType): WasmBezierC
default:
throw new Error("Invalid value for a BezierCurveType");
}
};
}