Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cassiopee
jalhyd
Commits
8f34026e
Commit
8f34026e
authored
Nov 20, 2019
by
Mathias Chouet
🍝
Browse files
getInferredValuesList(): add extendTo option, fix bug when in LISTE mode
parent
1c07939c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/param/param-definition.ts
View file @
8f34026e
...
...
@@ -477,10 +477,11 @@ export class ParamDefinition implements INamedIterableValues, IObservable {
/**
* Returns values as a number list, for LISTE and MINMAX modes;
* in MINMAX mode, infers the list from min/max/step values
* @param extendTo if given, will extend the values list to this number of values
*/
public
getInferredValuesList
()
{
public
getInferredValuesList
(
extendTo
?:
number
)
{
this
.
checkValueMode
([
ParamValueMode
.
LISTE
,
ParamValueMode
.
MINMAX
,
ParamValueMode
.
LINK
]);
return
this
.
paramValues
.
getInferredValuesList
(
false
,
undefined
,
true
);
return
this
.
paramValues
.
getInferredValuesList
(
false
,
extendTo
,
true
);
}
/**
...
...
src/param/param-values.ts
View file @
8f34026e
...
...
@@ -116,11 +116,15 @@ export class ParamValues implements IterableValues {
*/
public
getInferredValuesList
(
reverse
:
boolean
=
false
,
extendTo
?:
number
,
addLastStep
:
boolean
=
false
)
{
if
([
ParamValueMode
.
MINMAX
,
ParamValueMode
.
LISTE
].
includes
(
this
.
valueMode
))
{
// protection against infinite loops
if
(
this
.
step
!==
undefined
&&
this
.
step
>
0
&&
this
.
min
!==
undefined
&&
this
.
min
!==
null
&&
this
.
max
!==
undefined
&&
this
.
max
!==
null
(
this
.
valueMode
===
ParamValueMode
.
LISTE
)
||
(
this
.
valueMode
===
ParamValueMode
.
MINMAX
// protection against infinite loops
&&
this
.
step
!==
undefined
&&
this
.
step
>
0
&&
this
.
min
!==
undefined
&&
this
.
min
!==
null
&&
this
.
max
!==
undefined
&&
this
.
max
!==
null
)
)
{
const
it
=
this
.
initValuesIterator
(
reverse
,
extendTo
,
addLastStep
);
const
values
:
number
[]
=
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment