Fixing sequence no longer working with current rendering method.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f730121047
commit
a6fcf6da19
1 changed files with 6 additions and 2 deletions
|
@ -65,11 +65,15 @@ class Sequence extends Expr.Expression {
|
||||||
cache(n = 1) {
|
cache(n = 1) {
|
||||||
var str = Utils.simplifyExpression(this.calc.substitute('n', n-this.valuePlus).toString())
|
var str = Utils.simplifyExpression(this.calc.substitute('n', n-this.valuePlus).toString())
|
||||||
var expr = C.parser.parse(str).simplify()
|
var expr = C.parser.parse(str).simplify()
|
||||||
|
// Chache values required for this one.
|
||||||
|
if(!this.calcValues[n-this.valuePlus] && n-this.valuePlus > 0)
|
||||||
|
this.cache(n-this.valuePlus)
|
||||||
|
// Setting current variables
|
||||||
C.currentVars = Object.assign(
|
C.currentVars = Object.assign(
|
||||||
{'n': n-this.valuePlus}, // Just in case, add n (for custom functions)
|
{'n': n-this.valuePlus}, // Just in case, add n (for custom functions)
|
||||||
C.currentObjectsByName
|
C.currentObjectsByName,
|
||||||
|
{[this.name]: this.calcValues}
|
||||||
)
|
)
|
||||||
C.currentVars[this.name] = this.calcValues
|
|
||||||
this.calcValues[n] = expr.evaluate(C.currentVars)
|
this.calcValues[n] = expr.evaluate(C.currentVars)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue