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

Merge pull request #502 from lightest/CU-2au7jff_slider_radiobuttons_size

Slider radio-buttons size to match psychopy's
This commit is contained in:
Alain Pitiot 2022-06-09 12:54:49 +02:00 committed by GitHub
commit cd034249a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -843,10 +843,10 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin, WindowMixin)
{
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 +1148,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();
}
}