mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-08 20:34:35 +08:00
Update spline_editor.js
This commit is contained in:
parent
b560966027
commit
b5e654103a
@ -493,7 +493,7 @@ this.lastMousePosition = { x: this.width/2, y: this.height/2 };
|
||||
})
|
||||
.left(d => d.x)
|
||||
.top(d => d.y)
|
||||
.radius(10)
|
||||
.radius(12)
|
||||
.shape(function() {
|
||||
return self.dotShape;
|
||||
})
|
||||
@ -909,32 +909,32 @@ this.lastMousePosition = { x: this.width/2, y: this.height/2 };
|
||||
}
|
||||
});
|
||||
|
||||
// Add invisible wider hit area for easier selection
|
||||
this.vis.add(pv.Line)
|
||||
.data(() => spline.points)
|
||||
.left(d => d.x)
|
||||
.top(d => d.y)
|
||||
.interpolate(() => this.interpolation)
|
||||
.tension(() => this.tension)
|
||||
.segmented(() => false)
|
||||
.strokeStyle("rgba(0,0,0,0.01)") // Nearly invisible
|
||||
.lineWidth(15) // Much wider hit area
|
||||
.event("mouseover", () => {
|
||||
this.hoverSplineIndex = splineIndex;
|
||||
this.vis.render();
|
||||
})
|
||||
.event("mouseout", () => {
|
||||
this.hoverSplineIndex = -1;
|
||||
this.vis.render();
|
||||
})
|
||||
.event("mousedown", () => {
|
||||
if (pv.event.shiftKey) {
|
||||
if (this.activeSplineIndex !== splineIndex) {
|
||||
this.activeSplineIndex = splineIndex;
|
||||
this.refreshSplineElements();
|
||||
}
|
||||
}}
|
||||
);
|
||||
// // Add invisible wider hit area for easier selection
|
||||
// this.vis.add(pv.Line)
|
||||
// .data(() => spline.points)
|
||||
// .left(d => d.x)
|
||||
// .top(d => d.y)
|
||||
// .interpolate(() => this.interpolation)
|
||||
// .tension(() => this.tension)
|
||||
// .segmented(() => false)
|
||||
// .strokeStyle("rgba(0,0,0,0.01)") // Nearly invisible
|
||||
// .lineWidth(15) // Much wider hit area
|
||||
// .event("mouseover", () => {
|
||||
// this.hoverSplineIndex = splineIndex;
|
||||
// this.vis.render();
|
||||
// })
|
||||
// .event("mouseout", () => {
|
||||
// this.hoverSplineIndex = -1;
|
||||
// this.vis.render();
|
||||
// })
|
||||
// .event("mousedown", () => {
|
||||
// if (pv.event.shiftKey) {
|
||||
// if (this.activeSplineIndex !== splineIndex) {
|
||||
// this.activeSplineIndex = splineIndex;
|
||||
// this.refreshSplineElements();
|
||||
// }
|
||||
// }}
|
||||
// );
|
||||
|
||||
this.lineObjects.push(lineObj);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user