mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-09-26 08:09:11 +02:00
reordering
This commit is contained in:
@@ -2,6 +2,7 @@ import { enrich } from "../lib/enrich.js";
|
||||
import { Bezier } from "./types/bezier.js";
|
||||
import { Vector } from "./types/vector.js";
|
||||
import { Shape } from "./util/shape.js";
|
||||
import { Matrix } from "./util/matrix.js";
|
||||
import { BaseAPI } from "./base-api.js";
|
||||
|
||||
const MOUSE_PRECISION_ZONE = 5;
|
||||
@@ -103,6 +104,11 @@ class GraphicsAPI extends BaseAPI {
|
||||
this.currentPoint = undefined;
|
||||
}
|
||||
|
||||
resetMovable(points) {
|
||||
this.moveable.splice(0, this.moveable.length);
|
||||
if (points) this.setMovable(points);
|
||||
}
|
||||
|
||||
setMovable(points) {
|
||||
points.forEach((p) => this.moveable.push(p));
|
||||
}
|
||||
@@ -479,6 +485,10 @@ class GraphicsAPI extends BaseAPI {
|
||||
return Math.round(v);
|
||||
}
|
||||
|
||||
random(v = 1) {
|
||||
return Math.random() * v;
|
||||
}
|
||||
|
||||
abs(v) {
|
||||
return Math.abs(v);
|
||||
}
|
||||
@@ -517,4 +527,4 @@ class GraphicsAPI extends BaseAPI {
|
||||
}
|
||||
}
|
||||
|
||||
export { GraphicsAPI, Bezier, Vector };
|
||||
export { GraphicsAPI, Bezier, Vector, Matrix };
|
||||
|
Reference in New Issue
Block a user