diff --git a/crates/benilla-app/assets/ui/MapCanvas.lua b/crates/benilla-app/assets/ui/MapCanvas.lua index 5d6c3794..e87469d1 100644 --- a/crates/benilla-app/assets/ui/MapCanvas.lua +++ b/crates/benilla-app/assets/ui/MapCanvas.lua @@ -2123,9 +2123,26 @@ local function BuildCanvas() -- read off the binary, and the realm's minimize is the thing that spends it. Here it is one -- window's own declared stratum restored after the code that drops it, on the same hook that -- already re-seats the levels for the same reason. + -- + -- Restoring the window's stratum is not free: `SetFrameStrata` forces the whole subtree + -- (`0x76a470`), and `WorldMapTooltip` is **a child of this window with a stratum of its own** + -- -- `WorldMapFrame.xml:748` declares `frameStrata="TOOLTIP"`. The realm knows it: both + -- `WorldMapFrame_Minimize` (`WorldMapFrame.lua:210`) and `_Maximize` (`:284`) re-assert that + -- TOOLTIP on the line after their reparent. This hook runs after them, so the re-assert above + -- took the tooltip back down with it -- to FULLSCREEN, level 1, under `WorldMapDetailFrame` + -- at level 3. + -- + -- What that looks like is grom's report: a pfQuest node tooltip whose text and dark fill stop + -- dead at the map art's edge while its border, on pfUI's `backdrop_border` child at level 3, + -- carries on across it. Only in the windowed map, because `_Maximize` reparents to `nil` and + -- leaves the stratum alone, so the guard below never fires there. local function SeatLevels() if map:GetFrameStrata() ~= MAP_STRATA then map:SetFrameStrata(MAP_STRATA) + -- Put back what that just took, exactly as the realm's own two callers do. + if WorldMapTooltip then + WorldMapTooltip:SetFrameStrata("TOOLTIP") + end end local base = map:GetFrameLevel() or 0 sc:SetFrameLevel(base + 1) diff --git a/crates/benilla-app/src/ui_script/map_canvas_tests.rs b/crates/benilla-app/src/ui_script/map_canvas_tests.rs index ac786e2d..38c4f085 100644 --- a/crates/benilla-app/src/ui_script/map_canvas_tests.rs +++ b/crates/benilla-app/src/ui_script/map_canvas_tests.rs @@ -434,6 +434,31 @@ fn the_windowed_scale_does_not_reach_the_detail_frames_own_units() { ); } +/// `WorldMapTooltip` is a child of `WorldMapFrame` that declares a stratum of its own +/// (`WorldMapFrame.xml:748`, `frameStrata="TOOLTIP"`), and `SetFrameStrata` forces the whole +/// subtree. So the canvas's own `SeatLevels`, which exists to put the window's FULLSCREEN back +/// after the realm's `WorldMapFrame:SetParent(UIParent)` drops it, used to take the tooltip down +/// with it — to FULLSCREEN level 1, under `WorldMapDetailFrame` at level 3. +/// +/// grom saw that as a pfQuest node tooltip whose text and dark fill stop at the map art's edge +/// while pfUI's `backdrop_border` child, at level 3, draws across it. Windowed only: `_Maximize` +/// reparents to `nil` and leaves the stratum alone, so the re-assert never runs there. +#[test] +fn the_map_tooltip_keeps_its_own_stratum_through_both_window_modes() { + let Some(mut s) = harness() else { return }; + for call in ["WorldMapFrame_Minimize()", "WorldMapFrame_Maximize()"] { + s.run(call).expect("the stock mode switch runs"); + s.resolve(); + let strata: String = s + .eval("return WorldMapTooltip:GetFrameStrata()") + .expect("the tooltip answers a stratum"); + assert_eq!( + strata, "TOOLTIP", + "{call} left the map tooltip in {strata}, so the map art draws over it" + ); + } +} + /// 1.12 lays its map art out twice, once per window mode, and the canvas container has to be /// where that art would have been — `WorldMapFrame_Minimize` insets the detail frame 15,-33 /// inside a 720x521 window at scale 0.7 (701x468 of art: 15 left, 4 right, 33 top, 20 bottom),