| @@ -1720,8 +1720,6 @@ function testClick(event) { | |||||
| // todo remove some of this unused stuff | // todo remove some of this unused stuff | ||||
| const ratio = ratioW * ratioH; | const ratio = ratioW * ratioH; | ||||
| console.log("SDFSDFSD") | |||||
| console.log(ratio); | |||||
| const entity = entities[target.parentElement.dataset.key]; | const entity = entities[target.parentElement.dataset.key]; | ||||
| const angle = entity.rotation; | const angle = entity.rotation; | ||||
| @@ -1731,7 +1729,6 @@ function testClick(event) { | |||||
| alpha; | alpha; | ||||
| [xTarget,yTarget] = [x,y]; | [xTarget,yTarget] = [x,y]; | ||||
| console.log(xTarget); | |||||
| [actualW, actualH] = [target.getBoundingClientRect().width, target.getBoundingClientRect().height]; | [actualW, actualH] = [target.getBoundingClientRect().width, target.getBoundingClientRect().height]; | ||||
| xTarget -= actualW/2; | xTarget -= actualW/2; | ||||
| @@ -1765,9 +1762,6 @@ function testClick(event) { | |||||
| testCtx.fillStyle = "red"; | testCtx.fillStyle = "red"; | ||||
| alpha = testCtx.getImageData(xTarget, yTarget, 1, 1).data[3]; | alpha = testCtx.getImageData(xTarget, yTarget, 1, 1).data[3]; | ||||
| testCtx.fillRect(xTarget, yTarget, 3, 3); | testCtx.fillRect(xTarget, yTarget, 3, 3); | ||||
| // console.log(testCtx.canvas.width, testCtx.canvas.height); | |||||
| console.log(actualW, actualH); | |||||
| // console.log(xTarget, yTarget); | |||||
| // If the pixel is transparent, | // If the pixel is transparent, | ||||
| // retrieve the element underneath and trigger its click event | // retrieve the element underneath and trigger its click event | ||||
| @@ -4674,10 +4668,8 @@ function renderToCanvas() { | |||||
| ctx.save(); | ctx.save(); | ||||
| ctx.resetTransform(); | ctx.resetTransform(); | ||||
| ctx.translate(x, y); | ctx.translate(x, y); | ||||
| console.log(entity.rotation) | |||||
| ctx.rotate(entity.rotation); | ctx.rotate(entity.rotation); | ||||
| ctx.drawImage(img, -xSize/2, -ySize/2, xSize, ySize); | ctx.drawImage(img, -xSize/2, -ySize/2, xSize, ySize); | ||||
| console.log(x,y) | |||||
| ctx.restore(); | ctx.restore(); | ||||
| ctx.drawImage(document.querySelector("#rulers"), 0, 0); | ctx.drawImage(document.querySelector("#rulers"), 0, 0); | ||||
| ctx.translate(-xSize/2, -ySize/2); | ctx.translate(-xSize/2, -ySize/2); | ||||
| @@ -4794,14 +4786,12 @@ function panTo(x, y, height, xSpeed, ySpeed, heightSpeed, timestamp, remaining) | |||||
| } | } | ||||
| dt = timestamp - lastTime; | dt = timestamp - lastTime; | ||||
| remaining -= dt; | remaining -= dt; | ||||
| console.log(lastTime, remaining, dt) | |||||
| if (remaining < 0) { | if (remaining < 0) { | ||||
| dt += remaining | dt += remaining | ||||
| } | } | ||||
| let newX = config.x + xSpeed * dt; | let newX = config.x + xSpeed * dt; | ||||
| let newY = config.y + ySpeed * dt; | let newY = config.y + ySpeed * dt; | ||||
| let newHeight = config.height.toNumber("meters") + heightSpeed * dt; | let newHeight = config.height.toNumber("meters") + heightSpeed * dt; | ||||
| console.log(newX); | |||||
| if (remaining > 0) { | if (remaining > 0) { | ||||
| requestAnimationFrame((timestamp) => panTo(x, y, height, xSpeed, ySpeed, heightSpeed, timestamp, remaining)) | requestAnimationFrame((timestamp) => panTo(x, y, height, xSpeed, ySpeed, heightSpeed, timestamp, remaining)) | ||||
| } else { | } else { | ||||