Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/04/2017 in Posts

  1. I'm not sure what code you're using to get the mouse offset, but once you have it you can calculate the correct position by dividing the canvas real size by its visible size. // Assuming we already have a reference to canvas and the mouse's position // relative to it is in visibleX and visibleY var horizontalRatio = canvas.width / canvas.offsetWidth; var verticalRatio = canvas.height / canvas.offserHeight; var realX = horizontalRatio * visibleX; var realY = verticalRatio * visibleY; // Do something with realX and realY
    1 point
  2. Place both if conditions for setting modal and login to display none, in a single window.onclick function
    1 point
×
×
  • Create New...