From 934484e05448cbd7d5f4db438a2de82927551c57 Mon Sep 17 00:00:00 2001 From: Alain Pitiot Date: Sun, 24 May 2020 13:45:32 +0200 Subject: [PATCH] cancel a recent change to slider which seems to be creating issues; take devicePixelRatio into account in Windows --- js/core/Window.js | 3 ++- js/visual/Slider.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/core/Window.js b/js/core/Window.js index 0f4b63b..146394c 100644 --- a/js/core/Window.js +++ b/js/core/Window.js @@ -392,7 +392,8 @@ export class Window extends PsychObject { // create a PIXI renderer and add it to the document: this._renderer = PIXI.autoDetectRenderer(this._size[0], this._size[1], { - backgroundColor: this.color.int + backgroundColor: this.color.int, + resolution: window.devicePixelRatio }); this._renderer.view.style.transform = 'translatez(0)'; this._renderer.view.style.position = 'absolute'; diff --git a/js/visual/Slider.js b/js/visual/Slider.js index 4def2f2..9ec05fe 100644 --- a/js/visual/Slider.js +++ b/js/visual/Slider.js @@ -557,13 +557,14 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin) this._marker.pointerdown = this._marker.mousedown = this._marker.touchstart = (event) => { if (event.data.button === 0) { self._markerDragging = true; - +/* not quite right, just yet (as of May 2020) // set markerPos, but not rating: const mouseLocalPos_px = event.data.getLocalPosition(self._pixi); const rating = self._posToRating([mouseLocalPos_px.x, mouseLocalPos_px.y]); self._markerPos = self._granularise(rating); self._needMarkerUpdate = true; + */ } event.stopPropagation(); @@ -609,8 +610,11 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin) // (*) slider mouse events outside of marker // note: this only works thanks to eventCaptureRectangle - this._pixi.pointerdown = this._pixi.mousedown = this._pixi.touchstart = (event) => { - if (event.data.button === 0) { + /* not quite right just yet (as of May 2020) + this._pixi.pointerdown = this._pixi.mousedown = this._pixi.touchstart = (event) => + { + if (event.data.button === 0) + { self._markerDragging = true; // set markerPos, but not rating: @@ -625,6 +629,7 @@ export class Slider extends util.mix(VisualStim).with(ColorMixin) event.stopPropagation(); }; + */ this._pixi.pointerup = this._pixi.mouseup = this._pixi.touchend = (event) => { const mouseLocalPos_px = event.data.getLocalPosition(self._body);