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

cancel a recent change to slider which seems to be creating issues; take devicePixelRatio into account in Windows

This commit is contained in:
Alain Pitiot 2020-05-24 13:45:32 +02:00
parent 092829f325
commit 934484e054
2 changed files with 10 additions and 4 deletions

View File

@ -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';

View File

@ -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);