From b2b217fa098704c895dc76a859c8ecdcb5b170d5 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Thu, 23 Sep 2021 16:08:12 +0800 Subject: [PATCH] test canvas size --- public/self/js/Director/detection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/self/js/Director/detection.js b/public/self/js/Director/detection.js index b165e0ddc..c822d7515 100644 --- a/public/self/js/Director/detection.js +++ b/public/self/js/Director/detection.js @@ -2853,8 +2853,8 @@ function isJSON(str) { img.onload = function(){ loadFinished = false; // 初始设置画布大小,最大值宽和高 - canvas.width = maxWidth;//document.getElementById("tool0").offsetWidth; - canvas.height = maxHeight;//document.getElementById("tool0").offsetWidth/1280*720; + canvas.width = img.width;// maxWidth document.getElementById("tool0").offsetWidth; + canvas.height =img.height;//maxHeight document.getElementById("tool0").offsetWidth/1280*720; //调整画布大小 if ((img.width/img.height)<(canvas.width/canvas.height)){ canvas.width=canvas.height * img.width / img.height;