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

added proper if statement for blocking non 0 mousebuttons;

This commit is contained in:
lgtst 2022-07-06 20:02:48 +03:00
parent fa731254bc
commit 0f60204721

View File

@ -854,15 +854,17 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin, WindowMixin)
* @private * @private
*/ */
_handlePointerDown (e) { _handlePointerDown (e) {
if (e.data.button === 0) if (e.data.pointerType === "mouse" && e.data.button !== 0)
{ {
this._markerDragging = true; return;
if (!this._frozenMarker) }
{
const mouseLocalPos_px = e.data.getLocalPosition(this._pixi); this._markerDragging = true;
const rating = this._posToRating([mouseLocalPos_px.x, mouseLocalPos_px.y]); if (!this._frozenMarker)
this.setMarkerPos(rating); {
} const mouseLocalPos_px = e.data.getLocalPosition(this._pixi);
const rating = this._posToRating([mouseLocalPos_px.x, mouseLocalPos_px.y]);
this.setMarkerPos(rating);
} }
e.stopPropagation(); e.stopPropagation();