From 8852207b187ece1eb05afaa21827eb97b2f04bee Mon Sep 17 00:00:00 2001 From: Sergey Matyunin Date: Sun, 27 Sep 2026 02:12:56 +0300 Subject: [PATCH] =?UTF-8?q?test:=20=D1=81=D1=82=D0=B0=D0=B1=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D1=83=20=D1=83=D0=B3=D0=BB?= =?UTF-8?q?=D0=B0=20magnet=20=D0=BB=D0=B5=D1=81=D1=82=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=8B=20(#663)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: #663 User-Visible: no --- demo/smoke_stairs.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/smoke_stairs.mjs b/demo/smoke_stairs.mjs index 519ebeb7..858133ab 100644 --- a/demo/smoke_stairs.mjs +++ b/demo/smoke_stairs.mjs @@ -60,6 +60,10 @@ const out = await page.evaluate(async () => { const activeSpace = () => root().querySelector('[data-hp="space-tab"][aria-current="page"]') ?.getAttribute('data-id'); const closeTo = (a, b, tolerance = 1e-5) => Math.abs(a - b) <= tolerance; + const axisAngleDistance = (angle) => { + const normalized = ((angle % 180) + 180) % 180; + return Math.min(normalized, 180 - normalized); + }; const result = {}; await hp.setServerConfig((config) => { @@ -84,7 +88,7 @@ const out = await page.evaluate(async () => { result.straightCreatedOnlyOnCurrentFloor = !!straight && stairs('garden').length === 0; result.wallMagnetUsesPhysicalFace = !!straight && closeTo(Math.abs(straight.y * 1000 - 600), straight.width * 500 + (20 / 5) * (1000 / 240) / 2, 2) - && closeTo(((straight.angle % 180) + 180) % 180, 0); + && closeTo(axisAngleDistance(straight.angle), 0); result.spiralToolExists = await chooseStair('spiral'); await clickPlan([580, 650]);