From f0f2ce550acb456c1bb93fb189a3a62a2177cb9f Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Thu, 30 Apr 2026 10:28:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E9=80=BB=E8=BE=91=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?SDK=E5=AE=B9=E5=99=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将SDK容器的缩放计算逻辑移除,改为固定不缩放 调整SDK容器的CSS样式,使用绝对定位和vh单位 --- frontend/scripts/main.js | 13 +------------ frontend/styles/main.css | 14 +++++++------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/frontend/scripts/main.js b/frontend/scripts/main.js index 07657df..03bdae0 100644 --- a/frontend/scripts/main.js +++ b/frontend/scripts/main.js @@ -344,18 +344,7 @@ function calculateScale() { if (!sdkContainer) return; - const containerWidth = container.clientWidth; - const containerHeight = container.clientHeight; - - const sdkWidth = 1920; - const sdkHeight = 1080; - - const scaleX = containerWidth / sdkWidth; - const scaleY = containerHeight / sdkHeight; - const scale = Math.max(scaleX, scaleY); - - sdkContainer.style.transform = `scale(${scale})`; - sdkContainer.style.transformOrigin = 'center center'; + sdkContainer.style.transform = 'none'; } function toggleFullscreen() { diff --git a/frontend/styles/main.css b/frontend/styles/main.css index 9ea1b1d..c892577 100644 --- a/frontend/styles/main.css +++ b/frontend/styles/main.css @@ -550,22 +550,22 @@ body { left: 0; width: 100%; height: 100%; - display: flex; - align-items: center; - justify-content: center; overflow: hidden; z-index: 1; } .digital-human-box .sdk-scaling-wrapper .sdk-inner { - transform-origin: center center; - width: 100%; + position: absolute; + top: 0; + left: 50%; height: 100%; + transform: translateX(-50%); + transform-origin: center center; } .digital-human-box .sdk-scaling-wrapper .sdk-inner .digital-intelligent-interaction { - width: 100% !important; - height: 100% !important; + width: 177.78vh !important; + height: 100vh !important; } /* ===== 覆盖 SDK 字体大小 ===== */