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

Fix: setReadOnly(false) was having no effect

As noted in this discourse post:
https://discourse.psychopy.org/t/slider-setreadonly-sets-contrast-incorrectly/7055

Also, I wonder if we should be changing contrast by halving the color
values (if they are signed color vals) rather than the transparency, in
keeping with the Python version. Transparency will be weird if the scale
is on a textured backgorund?
This commit is contained in:
Jon Peirce 2019-04-10 17:36:21 +01:00
parent becf79b5d6
commit 9f0d4f75ce

View File

@ -274,6 +274,8 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin)
// halve the opacity: // halve the opacity:
if (readOnly) if (readOnly)
this._opacity /= 2.0; this._opacity /= 2.0;
else
this._opacity *= 2.0;
this._needUpdate = true; this._needUpdate = true;
} }