Skip to content

Commit d834128

Browse files
committed
Fix endpoint for sliders
1 parent a78794a commit d834128

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

media/src/objects/Curve.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
} else {
172172
tau += dt / (B - A);
173173
}
174-
tau %= 1;
174+
if (tau > 1) tau %= 1;
175175
// const T = A + (B - A) * tau;
176176
177177
// uncomment this if we want aVal to be animated:

media/src/objects/Function.svelte

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
610610
const update = function (dt) {
611611
tau += dt / (t1 - t0);
612-
tau %= 1;
612+
if (tau > 1) tau %= 1;
613613
614614
evolveSurface(tVal);
615615
@@ -799,26 +799,25 @@
799799
boxMesh.add(boxMeshEdges);
800800
801801
const updateBoxes = function () {
802-
const { a, b, c, d} = params;
802+
const { a, b, c, d } = params;
803803
try {
804-
[
804+
[
805805
math.evaluate(a),
806806
math.evaluate(b),
807807
math.evaluate(c),
808808
math.evaluate(d),
809809
];
810810
} catch (e) {
811-
console.error("Can't show integral boxes on nonconstant bounds",e);
811+
console.error("Can't show integral boxes on nonconstant bounds", e);
812812
return;
813813
}
814814
815815
const [A, B, C, D] = [
816-
math.evaluate(a),
817-
math.evaluate(b),
818-
math.evaluate(c),
819-
math.evaluate(d),
820-
];
821-
816+
math.evaluate(a),
817+
math.evaluate(b),
818+
math.evaluate(c),
819+
math.evaluate(d),
820+
];
822821
823822
// const t = T0 + tau * (T1 - T0);
824823

media/src/objects/Point.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
216216
const update = (dt = 0) => {
217217
tau += dt / (t1 - t0);
218-
tau %= 1;
218+
if (tau > 1) tau %= 1;
219219
updatePoint(tVal);
220220
};
221221
// Start animating if animation changes (e.g. animating scene published)

media/src/objects/Surface.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@
590590
591591
const update = function (dt = 0) {
592592
tau += dt / (t1 - t0);
593-
tau %= 1;
593+
if (tau > 1) tau %= 1;
594594
595595
if (isDynamic) evolveSurface(tVal);
596596
if (isRhoDynamic) {

media/src/objects/Vector.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
const B = math.parse(t1).evaluate();
257257
258258
tau += dt / (B - A);
259-
tau %= 1;
259+
if (tau > 1) tau %= 1;
260260
261261
updateVector(tVal);
262262
};

media/src/stories/FluxIntegral.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
// const currentTime = $tickTock;
4747
last = last || $tickTock;
4848
tau += $tickTock - last;
49-
tau %= 1;
49+
if (tau > 1) tau %= 1;
5050
updateTau(tau);
5151
last = $tickTock;
5252
}

0 commit comments

Comments
 (0)