map: the windowed art buried the continent and zone dropdowns

grom: "the map is not properly sized in the window and I can't see/click the
dropdowns at the top". What was on screen was two small circles and a search box
above the parchment -- the bottom edge of pfUI's title bar, everything under it
covered by the map sheet.

Measured on his own saved variables: WORLDMAP_WINDOWED is 1, so the realm runs
WorldMapFrame_Minimize at VARIABLES_LOADED, which pins WorldMapPositioningGuide
to the window's own corners (WorldMapFrame.lua:201-203). Both dropdowns anchor
to that guide at TOP -80,-35, so windowed they sit 34 to 66 below the window's
top -- which is why the same function hides them three lines later. pfUI puts
them back (SkinDropDown) into a window it sizes to WorldMapButton plus 15x55 of
chrome, eleven short of the 66 their anchor wants. 31 of their 32 points ended
up under WorldMapDetailFrame, level 3 against their 1.

The reference buries them too; what is ours is that our canvas fills the window
an addon sized rather than leaving the art a 701x468 patch in the corner of it,
which makes the burial total. So WindowedInset gives them the band when they are
visible: the art starts four points below the lower dropdown. Hidden -- stock,
and every chain without a map addon -- the inset stays 1.12's own 33 and the
windowed map is pixel-identical.

The cost is 35 points of art height in that window, so the fit zoom lands at 0.95
and the sheet is pillarboxed about 17 points a side.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
This commit is contained in:
2026-11-09 08:11:36 -07:00
co-authored by Claude Opus 5
parent d1d44a7801
commit f080e95b8d
3 changed files with 158 additions and 1 deletions
+59 -1
View File
@@ -968,11 +968,69 @@ end
local WINDOWED_INSET = { l = 15, t = 33, r = 4, b = 20 }
local MAXIMIZED_INSET = { l = 10, t = 69, r = 12, b = 31 }
-- The windowed top inset has one thing it has to clear that 33 does not cover: the continent and
-- zone dropdowns, when something has made them visible again.
--
-- 1.12 anchors both to `WorldMapPositioningGuide` at `TOP, -80, -35`, and `WorldMapFrame_Minimize`
-- pins that guide to the window's own corners (`WorldMapFrame.lua:201-203`) -- so in windowed mode
-- they sit 34 to 66 below the window's top, under art that starts at 33. The realm knows: three
-- lines further on the same function sets their alpha to 0 and takes the mouse off them, because
-- a 720x521 window has nowhere else to put them.
--
-- pfUI puts them back. `SkinDropDown` runs over both (`pfUI/modules/map.lua:154`), and the window
-- it sizes them into is `WorldMapButton` plus 15x55 of chrome -- room for a title bar, except
-- that the dropdowns' own anchor wants 66 of it. So they return at full alpha into a band the art
-- is using, 31 of their 32 points under `WorldMapDetailFrame`, which draws at level 3 against
-- their 1. grom, 2026-11-09: *"I can't see/click the dropdowns at the top"* -- what is left of
-- them is a one-point sliver, and a click on it lands on the map.
--
-- That is the reference's behaviour too, art and all; what is ours is that our art fills the
-- window the addon sized instead of staying a 701x468 patch in the corner of it, which is what
-- makes the burial total. So: when they are visible, the art starts below them. When they are
-- hidden -- which is stock, and every chain without a map addon -- the inset is 1.12's own 33 and
-- the windowed map is pixel-identical to what it was.
local DROPDOWN_CLEARANCE = 4
local windowedInset = { l = 15, t = 33, r = 4, b = 20 }
local function WindowedInset()
local map = WorldMapFrame
windowedInset.l, windowedInset.r = WINDOWED_INSET.l, WINDOWED_INSET.r
windowedInset.b, windowedInset.t = WINDOWED_INSET.b, WINDOWED_INSET.t
if not map then
return windowedInset
end
local ms = map:GetEffectiveScale()
local top = map:GetTop()
if not ms or ms <= 0 or not top then
return windowedInset
end
top = top * ms
local list = { WorldMapContinentDropDown, WorldMapZoneDropDown }
local i
for i = 1, 2 do
local dd = list[i]
if dd and dd:IsShown() and (dd:GetAlpha() or 0) > 0.01 then
dd:GetLeft()
local ds, bottom = dd:GetEffectiveScale(), dd:GetBottom()
if ds and ds > 0 and bottom then
local below = (top - bottom * ds) / ms + DROPDOWN_CLEARANCE
-- A dropdown above the window's top, or one somewhere past the middle of it, is
-- not a title bar and is not this rule's business.
local limit = (map:GetHeight() or 0) * 0.5
if below > windowedInset.t and below < limit then
windowedInset.t = below
end
end
end
end
return windowedInset
end
-- `(host, inset)` for the current mode: the frame the content area is measured in, and how far
-- inside it the art sits.
local function ContentHost()
if WORLDMAP_WINDOWED == 1 then
return WorldMapFrame, WINDOWED_INSET
return WorldMapFrame, WindowedInset()
end
return WorldMapPositioningGuide or WorldMapFrame, MAXIMIZED_INSET
end
@@ -506,6 +506,61 @@ fn the_canvas_container_is_the_windows_content_area_in_both_map_modes() {
}
}
/// The windowed art starts below the continent and zone dropdowns when something has made them
/// visible, and stays at 1.12's own 33 when nothing has.
///
/// 1.12 anchors both dropdowns to `WorldMapPositioningGuide` at `TOP, -80, -35`, and
/// `WorldMapFrame_Minimize` pins that guide to the window's own corners
/// (`WorldMapFrame.lua:201-203`) -- so windowed they sit 34 to 66 below the window's top, under
/// art that starts at 33. The realm hides them three lines later for exactly that reason.
///
/// pfUI un-hides them: `SkinDropDown` runs over both and the window it sizes is `WorldMapButton`
/// plus 15x55 of chrome, which is less than their anchor wants. Measured on grom's chain, 31 of
/// their 32 points were under `WorldMapDetailFrame` -- level 3 against their 1 -- so what was
/// left on screen was a one-point sliver of each and a click on it reached the map.
#[test]
fn a_visible_map_dropdown_gets_the_windowed_art_out_from_under_it() {
let Some(mut s) = harness() else { return };
s.run("WorldMapFrame_Minimize()")
.expect("the stock mode switch runs");
s.resolve();
// Stock: the realm hid them, so the band is 1.12's own and the map is as it was.
let (map_top, art_top): (f64, f64) = s
.eval(
"WorldMapScrollContainer:GetLeft() \
return WorldMapFrame:GetTop(), WorldMapScrollContainer:GetTop()",
)
.unwrap();
assert!(
(map_top - art_top - 33.0).abs() < 1.0,
"hidden dropdowns must leave 1.12's own 33-point band, got {}",
map_top - art_top
);
// What pfUI does, in its own order: un-hide both, then size the window to the art plus its
// chrome. The resize is what re-seats the container.
s.run(
"WorldMapContinentDropDown:SetAlpha(1) WorldMapZoneDropDown:SetAlpha(1) \
WorldMapFrame:SetWidth(1017) WorldMapFrame:SetHeight(723)",
)
.expect("an addon may resize the map window and show its dropdowns");
s.resolve();
let (art_top, dd_bottom): (f64, f64) = s
.eval(
"WorldMapScrollContainer:GetLeft() \
return WorldMapScrollContainer:GetTop(), WorldMapContinentDropDown:GetBottom()",
)
.unwrap();
assert!(
art_top <= dd_bottom,
"the art starts at {art_top} and the dropdown ends at {dd_bottom}, so {} points of it \
are buried",
art_top - dd_bottom
);
}
/// A wheel notch steps from where the view is **heading**, so notches accumulate while the
/// smooth zoom is still easing toward the last one.
///