1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

nested ternary expression replaced by if-else if statements;

This commit is contained in:
lgtst 2022-06-15 12:46:17 +03:00
parent aaddd07065
commit 5f666e7e44

View File

@ -932,7 +932,17 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin, WindowMixin)
// marker:
this._marker = new PIXI.Graphics();
const markerVal = Number.isFinite(this._rating) ? this._rating : (Number.isFinite(this._startValue) ? this._startValue : undefined);
let markerVal = undefined;
if (Number.isFinite(this._rating))
{
markerVal = this._rating;
}
else if (Number.isFinite(this._startValue))
{
markerVal = this._startValue;
}
if (Number.isFinite(markerVal))
{
this._markerPos = this._granularise(markerVal);