From 745e727ef7e7f526312a3fe7ddc363ade2d10048 Mon Sep 17 00:00:00 2001 From: xiaozhou233 Date: Sat, 1 Aug 2026 11:39:18 +0800 Subject: [PATCH] =?UTF-8?q?BugFix:=20=E6=8B=96=E5=8A=A8=E6=9C=A8=E5=9D=97?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=B9=85=E5=BA=A6=E5=A4=AA=E5=A4=A7=E4=BC=9A?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E6=91=86=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- forces.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/forces.html b/forces.html index 4b3dc77..770e10f 100644 --- a/forces.html +++ b/forces.html @@ -1097,6 +1097,14 @@ l

力是物体对物体的作用,力不能脱离物体 else vel = Math.min(0, vel + fricStep); } } + // 拖拽时按距光标的剩余距离限制速度,越接近光标限速越低, + // 避免速度过大冲过光标后弹簧反向拉回造成左右摆动 + if(dragging && moving){ + const pullNow = dragTargetX - (box.x + box.w / 2); + const limitV = Math.abs(pullNow) * 0.18 + 0.5; + if(vel > limitV) vel = limitV; + else if(vel < -limitV) vel = -limitV; + } if(moving){ box.x += vel * 0.016 * 60; if(box.x < 20){ box.x = 20; vel = 0; moving = false; }