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

radio buttons size set to match psychopy's;

This commit is contained in:
lgtst 2022-05-25 18:39:10 +03:00
parent 8a3c6c0a28
commit c0c63accb5

View File

@ -837,16 +837,17 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin, WindowMixin)
this._body.interactive = true;
this._pixi.addChild(this._body);
// ensure that pointer events will be captured along the slider body, even outside of
// marker and labels:
if (this._tickType === Slider.Shape.DISC)
{
const maxTickSize_px = Math.max(this._tickSize_px[0], this._tickSize_px[1]);
this._body.hitArea = new PIXI.Rectangle(
-this._barSize_px[0] / 2 - maxTickSize_px,
-this._barSize_px[1] / 2 - maxTickSize_px,
this._barSize_px[0] + maxTickSize_px * 2,
this._barSize_px[1] + maxTickSize_px * 2,
-(this._barSize_px[0] + maxTickSize_px) * 0.5,
-(this._barSize_px[1] + maxTickSize_px) * 0.5,
this._barSize_px[0] + maxTickSize_px,
this._barSize_px[1] + maxTickSize_px,
);
}
else
@ -1148,7 +1149,7 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin, WindowMixin)
else if (this._tickType === Slider.Shape.DISC)
{
this._body.beginFill(this._tickColor.int, 1);
this._body.drawCircle(tickPosition_px[0], tickPosition_px[1], maxTickSize);
this._body.drawCircle(tickPosition_px[0], tickPosition_px[1], maxTickSize * 0.5);
this._body.endFill();
}
}