processing / p5.js-editor

Deprecated desktop editor for p5.js
https://p5js.org
MIT License
338 stars 91 forks source link

pmouseX always equal to mouseX #198

Closed BarbaraAlmeida closed 8 years ago

BarbaraAlmeida commented 8 years ago

When using p5.js v0.4.20 from December 11, 2015 pmouseX/Y is always equal to mouseX/Y.

I've tried the p5.js files on this issue:

In p5.js v0.4.17 from October 25, 2015 (the one that solved the issue) they are also behaving weirdly: pmouseX/Y is not equal to mouseX/Y when the mouse stops moving (seems to be the same problem reported here) and line(mouseX, mouseY, pmouseX, pmouseY); produces a dashed line.

It seems to work fine with p5.js v0.4.17 from October 13, 2015.

Code:

function setup() {
  createCanvas(500, 500);
  background(240);
}

function draw() {  
  line(mouseX, mouseY, pmouseX, pmouseY);

  fill(255);
  rect(0, 0, 300, 50);

  fill(0);
  text("mouseX = " + mouseX, 30, 20);
  text("pmouseX = " + pmouseX, 30, 35);

  text("mouseY = " + mouseY, 180, 20);
  text("pmouseY = " + pmouseY, 180, 35);

  if (mouseX == pmouseX) {
    ellipse(10, 20, 10, 10);
  }

   if (mouseX == pmouseX) {
    ellipse(160, 20, 10, 10);
  }
}

function mousePressed() {
  background(240);
}
BarbaraAlmeida commented 8 years ago

Sorry, I reported to the editor GitHub by mistake. Now reported here.