tweaked curve point dragging thresholds
parent
21ffc99bbb
commit
a6d901d3f0
|
|
@ -671,10 +671,10 @@ export class CurveEditor {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no handle was hit, then check points
|
||||
for (let curve of this.curves) {
|
||||
// If no handle was hit, then check points
|
||||
for (let curve of this.curves) {
|
||||
for (let key of ['startPoint', 'endPoint']) {
|
||||
const p = curve[key];
|
||||
if (Math.hypot(p.x - mouse.x, p.y - mouse.y) < 10 / this.scale) {
|
||||
|
|
@ -682,7 +682,7 @@ for (let curve of this.curves) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
|
@ -774,7 +774,7 @@ for (let curve of this.curves) {
|
|||
const curves = this.curveSets[motorID];
|
||||
if (!curves) return;
|
||||
|
||||
const tolerance = 2; // pixels/frames tolerance for matching existing points
|
||||
const tolerance = 4; // pixels/frames tolerance for matching existing points
|
||||
|
||||
for (let i = 0; i < curves.length; i++) {
|
||||
const curve = curves[i];
|
||||
|
|
@ -787,7 +787,7 @@ for (let curve of this.curves) {
|
|||
curve.startPoint.y = yEditor;
|
||||
if (curve.startPointHandle) curve.startPointHandle.y = yEditor;
|
||||
} else {
|
||||
// remove point by merging with previous
|
||||
// 🚫 don't allow deleting the very first control point
|
||||
if (i > 0) {
|
||||
const prev = curves[i - 1];
|
||||
const merged = {
|
||||
|
|
@ -797,8 +797,6 @@ for (let curve of this.curves) {
|
|||
endPoint: curve.endPoint
|
||||
};
|
||||
curves.splice(i - 1, 2, merged);
|
||||
} else {
|
||||
curves.splice(i, 1); // drop if it's the very first
|
||||
}
|
||||
}
|
||||
this.curveSets[motorID] = curves;
|
||||
|
|
@ -814,7 +812,7 @@ for (let curve of this.curves) {
|
|||
curve.endPoint.y = yEditor;
|
||||
if (curve.endPointHandle) curve.endPointHandle.y = yEditor;
|
||||
} else {
|
||||
// remove point by merging with next
|
||||
// 🚫 don't allow deleting the very last control point
|
||||
if (i < curves.length - 1) {
|
||||
const next = curves[i + 1];
|
||||
const merged = {
|
||||
|
|
@ -824,8 +822,6 @@ for (let curve of this.curves) {
|
|||
endPoint: next.endPoint
|
||||
};
|
||||
curves.splice(i, 2, merged);
|
||||
} else {
|
||||
curves.splice(i, 1); // drop if it's the very last
|
||||
}
|
||||
}
|
||||
this.curveSets[motorID] = curves;
|
||||
|
|
@ -869,7 +865,8 @@ for (let curve of this.curves) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
adjustAllCurvesToDuration(newTime) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue