From 1e9ef80c418fe02b45005b250904c64195fc8394 Mon Sep 17 00:00:00 2001 From: grom Date: Sun, 25 Oct 2026 16:13:03 -0600 Subject: [PATCH] superwow: pin the bubble's seat, the one placement that could be silently wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The widget tests proved the frame's size, its alpha and its text; none of them would have noticed an anchor on the wrong point, which would still size and draw — just in the wrong place. The bubble hangs from its bottom centre on the projected point and grows UPWARD (`0x4b0c30`), so the test now reads `GetCenter`, `GetBottom` and `GetTop` back and pins all three. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn --- crates/benilla-ui/src/script/chat_bubble.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/benilla-ui/src/script/chat_bubble.rs b/crates/benilla-ui/src/script/chat_bubble.rs index 185574fd..17684d70 100644 --- a/crates/benilla-ui/src/script/chat_bubble.rs +++ b/crates/benilla-ui/src/script/chat_bubble.rs @@ -696,6 +696,26 @@ mod tests { return f:GetWidth() == 120 and f:GetHeight() == 40 and f:GetAlpha() == 0.5" ) .unwrap()); + // **The seat, which is the one thing most easily wrong**: the bubble hangs from its bottom + // centre on the projected point and grows UPWARD (`0x4b0c30`). An anchor on the wrong + // point would still size and draw, just in the wrong place — and nothing else here would + // notice. + assert_eq!( + s.eval::<(f64, f64)>( + "local f = C_ChatBubbles.GetAllChatBubbles()[1] + local cx = f:GetCenter() + return cx, f:GetBottom()" + ) + .unwrap(), + (400.0, 300.0), + "bottom centre on the seat the app handed over" + ); + assert_eq!( + s.eval::("return C_ChatBubbles.GetAllChatBubbles()[1]:GetTop()") + .unwrap(), + 340.0, + "and the height is added upward, not downward" + ); assert!( s.eval::( "local f = C_ChatBubbles.GetAllChatBubbles()[1]