Просмотр исходного кода

Fix the click-test canvas being way too large

master
Fen Dweller 4 лет назад
Родитель
Сommit
5b0712db63
1 измененных файлов: 6 добавлений и 5 удалений
  1. +6
    -5
      macrovision.js

+ 6
- 5
macrovision.js Просмотреть файл

@@ -1731,14 +1731,12 @@ function testClick(event) {
[xTarget,yTarget] = [x,y]; [xTarget,yTarget] = [x,y];


[actualW, actualH] = [target.getBoundingClientRect().width, target.getBoundingClientRect().height]; [actualW, actualH] = [target.getBoundingClientRect().width, target.getBoundingClientRect().height];
xTarget -= actualW/2;
xTarget /= ratio; xTarget /= ratio;
xTarget += actualW/2;
yTarget -= actualH/2;
yTarget /= ratio; yTarget /= ratio;
yTarget += actualH/2;


actualW /= ratio;
actualH /= ratio;


testCtx.canvas.width = actualW; testCtx.canvas.width = actualW;
testCtx.canvas.height = actualH; testCtx.canvas.height = actualH;
@@ -1747,6 +1745,9 @@ function testClick(event) {


// dear future me: Sorry :( // dear future me: Sorry :(


console.log(w, h);
console.log(actualW, actualH)
console.log(xTarget, yTarget)
testCtx.resetTransform(); testCtx.resetTransform();






Загрузка…
Отмена
Сохранить