mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-09-28 00:59:00 +02:00
pointvectors
This commit is contained in:
@@ -200,7 +200,7 @@ class BaseAPI {
|
||||
*/
|
||||
setup() {
|
||||
// console.log(`setup`);
|
||||
this.moveable = [];
|
||||
this.movable = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -72,8 +72,8 @@ class GraphicsAPI extends BaseAPI {
|
||||
? TOUCH_PRECISION_ZONE
|
||||
: MOUSE_PRECISION_ZONE;
|
||||
|
||||
for (let i = 0, e = this.moveable.length, p, d; i < e; i++) {
|
||||
p = this.moveable[i];
|
||||
for (let i = 0, e = this.movable.length, p, d; i < e; i++) {
|
||||
p = this.movable[i];
|
||||
d = new Vector(p).dist(this.cursor);
|
||||
if (d <= cdist) {
|
||||
this.currentPoint = p;
|
||||
@@ -88,8 +88,8 @@ class GraphicsAPI extends BaseAPI {
|
||||
this.currentPoint.x = this.cursor.x;
|
||||
this.currentPoint.y = this.cursor.y;
|
||||
} else {
|
||||
for (let i = 0, e = this.moveable.length, p; i < e; i++) {
|
||||
p = this.moveable[i];
|
||||
for (let i = 0, e = this.movable.length, p; i < e; i++) {
|
||||
p = this.movable[i];
|
||||
if (new Vector(p).dist(this.cursor) <= 5) {
|
||||
this.setCursor(this.HAND);
|
||||
return; // NOTE: this is a return, not a break.
|
||||
@@ -105,12 +105,12 @@ class GraphicsAPI extends BaseAPI {
|
||||
}
|
||||
|
||||
resetMovable(points) {
|
||||
this.moveable.splice(0, this.moveable.length);
|
||||
this.movable.splice(0, this.movable.length);
|
||||
if (points) this.setMovable(points);
|
||||
}
|
||||
|
||||
setMovable(points) {
|
||||
points.forEach((p) => this.moveable.push(p));
|
||||
points.forEach((p) => this.movable.push(p));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user