refactor(editor): add gfx entry in bs global package (#10612)

This commit is contained in:
Saul-Mirone
2025-03-04 12:46:50 +00:00
parent 5ad3d3c94a
commit 66d9d576e0
216 changed files with 341 additions and 397 deletions
@@ -1,5 +1,4 @@
// control coords are not relative to start or end
import { assertExists } from './assert.js';
import { CURVETIME_EPSILON, isZero } from './math.js';
import { Bound, type IVec, PointLocation, Vec } from './model/index.js';
@@ -111,7 +110,7 @@ export function getBezierNearestTime(
function refine(t: number) {
if (t >= 0 && t <= 1) {
const tmpPoint = getBezierPoint(values, t);
assertExists(tmpPoint);
if (!tmpPoint) return false;
const dist = Vec.dist2(point, tmpPoint);
if (dist < minDist) {
minDist = dist;
@@ -137,7 +136,6 @@ export function getBezierNearestPoint(
) {
const t = getBezierNearestTime(values, point);
const pointOnCurve = getBezierPoint(values, t);
assertExists(pointOnCurve);
return pointOnCurve;
}
@@ -0,0 +1,7 @@
export * from './bound.js';
export * from './curve.js';
export * from './math.js';
export * from './model/index.js';
export * from './perfect-freehand/index.js';
export * from './polyline.js';
export * from './xywh.js';
@@ -1,18 +1,10 @@
export * from './assert.js';
export * from './bound.js';
export * from './crypto.js';
export * from './curve.js';
export * from './disposable.js';
export * from './function.js';
export * from './iterable.js';
export * from './logger.js';
export * from './math.js';
export * from './model/index.js';
export * from './perfect-freehand/index.js';
export * from './polyline.js';
export * from './signal-watcher.js';
export * from './slot.js';
export * from './types.js';
export * from './with-disposable.js';
export type { SerializedXYWH, XYWH } from './xywh.js';
export { deserializeXYWH, serializeXYWH } from './xywh.js';