mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-30 19:50:01 +02:00
table sliders + FF scroll fix
This commit is contained in:
@@ -56,19 +56,16 @@ draw() {
|
||||
}
|
||||
|
||||
drawHighlight() {
|
||||
let c = screenToWorld({
|
||||
x: map(this.position, -0.1, 1.1, 0, this.width),
|
||||
y: this.height/2
|
||||
});
|
||||
const t = this.position;
|
||||
|
||||
if (c.x < 0) return;
|
||||
if (c.x > this.width) return;
|
||||
if (t===0) return;
|
||||
if (t===1) return;
|
||||
|
||||
noStroke();
|
||||
setFill(`rgba(255,0,0,0.3)`);
|
||||
rect(c.x - 2, 0, 5, this.height);
|
||||
rect(t*this.width - 2, 0, 5, this.height);
|
||||
|
||||
const p = this.f.map(f => f(c.x / this.width));
|
||||
const p = this.f.map(f => f(t));
|
||||
|
||||
setFill(`black`);
|
||||
p.forEach(p => {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
let curve;
|
||||
|
||||
setup() {
|
||||
setPanelCount(3);
|
||||
curve = Bezier.defaultCubic(this);
|
||||
setMovable(curve.points);
|
||||
setSlider(`.slide-control`, `position`, 0.5);
|
||||
@@ -16,16 +17,15 @@ draw() {
|
||||
|
||||
this.drawBasics(p);
|
||||
|
||||
translate(this.width/3, 0);
|
||||
nextPanel();
|
||||
setStroke(`black`);
|
||||
line(0, 0, 0, this.height);
|
||||
|
||||
this.drawSegment(c1, p, `first`);
|
||||
|
||||
translate(this.width/3, 0);
|
||||
nextPanel();
|
||||
|
||||
setStroke(`black`);
|
||||
line(0, 0, 0, this.height);
|
||||
|
||||
this.drawSegment(c2, p, `second`);
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ drawSegment(c, p, halfLabel) {
|
||||
setStroke(`lightblue`);
|
||||
curve.drawCurve(`lightblue`);
|
||||
curve.drawSkeleton(`lightblue`);
|
||||
curve.drawStruts(this.struts);
|
||||
c.drawCurve();
|
||||
c.drawSkeleton(`black`);
|
||||
c.points.forEach(p => circle(p.x, p.y, 3));
|
||||
noFill();
|
||||
setStroke(`red`);
|
||||
circle(p.x, p.y, 3);
|
||||
|
Reference in New Issue
Block a user