From 137de8bc526b2e4cce1d1830e212fb0bad3c72e7 Mon Sep 17 00:00:00 2001 From: dongjf <1+dongjf@noreply.git.tutudog.com> Date: Fri, 27 Nov 2026 17:29:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E9=BD=90=E5=AE=B6=E5=85=B7?= =?UTF-8?q?=E6=8F=92=E7=94=BB=E5=92=8C=E6=A8=A1=E6=9D=BF=E5=8D=A0=E5=9C=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/ui/ios/location-layout.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/ui/ios/location-layout.html b/docs/ui/ios/location-layout.html index 49c5cf9..0ee949b 100644 --- a/docs/ui/ios/location-layout.html +++ b/docs/ui/ios/location-layout.html @@ -248,7 +248,7 @@ zone: ["开放区域", "zone", 27, 25], sofa: ["沙发", "furniture", 25, 13], wardrobe: ["衣柜", "furniture", 30, 19], cabinet: ["电视柜", "furniture", 40, 14], shelf: ["书架", "furniture", 20, 26], - bed: ["床", "furniture", 29, 36], desk: ["桌子", "furniture", 32, 19], + bed: ["床", "furniture", 22, 36], desk: ["桌子", "furniture", 32, 19], rack: ["层架", "furniture", 24, 20], box: ["收纳箱", "furniture", 16, 20], table: ["边几", "furniture", 18, 19], generic: ["其他", "zone", 20, 20] @@ -338,11 +338,17 @@ [62,23,21,36,"sageLight",4],[87,23,21,36,"sageLight",4]] }; function illustration(mold) { + const pieces = silhouettes[mold]; + const left = Math.min(...pieces.map(([x]) => x)) - 2; + const top = Math.min(...pieces.map(([,y]) => y)) - 2; + const right = Math.max(...pieces.map(([x,,w]) => x + w)) + 2; + const bottom = Math.max(...pieces.map(([,y,,h]) => y + h)) + 2; const drawing = document.createElement("canvas"); - drawing.width = 240; drawing.height = 160; + drawing.width = (right - left) * 2; drawing.height = (bottom - top) * 2; const pen = drawing.getContext("2d"); - pen.scale(2,2); pen.strokeStyle = "#594e50"; pen.lineWidth = 1.5; - silhouettes[mold].forEach(([x,y,w,h,color,radius]) => { + pen.scale(2,2); pen.translate(-left,-top); + pen.strokeStyle = "#594e50"; pen.lineWidth = 1.5; + pieces.forEach(([x,y,w,h,color,radius]) => { pen.beginPath(); pen.roundRect(x,y,w,h,radius); pen.fillStyle = palette[color]; pen.fill(); pen.stroke(); });