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