Chinchilla Minimap

Chinchilla Minimap

2M Downloads

Interaction between Chinchilla, Viewports, and Blizz MultiActionBar

cdgori opened this issue · 3 comments

commented

I put my mini-map (Chinchilla) in the bottom right, and have a viewport defined covering the bottom ~160 pixels of screen, about an eighth of the screen. I get these sort of errors (I think they fire on PLAYER_ENTERING_WORLD if I'm not mistaken, I get them on every zone change), from BugSack/BugGrabber:

68x FrameXML\MultiActionBars.lua:85: MultiBarRight:SetScale(): Scale must be > 0
[C]: in function SetScale' FrameXML\MultiActionBars.lua:85: in function MultiActionBar_Update'
FrameXML\InterfaceOptionsPanels.lua:1184: in function InterfaceOptions_UpdateMultiActionBars' [string "*:OnLoad"]:4: in function setFunc'
FrameXML\InterfaceOptionsPanels.lua:1154: in function <FrameXML\InterfaceOptionsPanels.lua:1147>

Locals:
(*temporary) = MultiBarRight {
0 =
slideOut = {
}
}
(*temporary) = -0.26561135468379

If I disable Chinchilla (or use SexyMap - but I definitely prefer Chinchilla!) they go away. It looks like the blizzard code at/above line 85 of MultiActionBars.lua makes some assumptions about placement (?) - here's some of their code:

	local topLimit = MinimapCluster:GetBottom() - 10;	-- increasing by 14 here because we can overlap since the cluster is bigger than the elements it contains
	local bottomLimit = MicroButtonAndBagsBar:GetTop() + 24;

	local availableSpace = topLimit - bottomLimit;

...
if ( contentHeight > availableSpace ) then
scale = availableSpace / contentHeight;
end
MultiBarRight:SetScale(scale); <- cdgori: this is line 85

Here's the relevant blizzard file expanded out if you want to see it:
https://github.com/tomrus88/BlizzardInterfaceCode/blob/master/Interface/FrameXML/MultiActionBars.lua

I'm not sure what is actually going wrong here, I know that Chinchilla sets its position in Position.lua (SetMinimapPosition calls MinimapCluster:SetPoint, which I think is what is doing it, but I didn't trace all of the logic/calculations backwards).

In my UI setup, MinimapCluster:GetBottom() is -11.6025 and MicroButtonAndBagsBar:GetTop() is 87.9999, so obviously when the Blizz code computes availableSpace it's going to be negative.

I can imagine this being Blizzard not accounting for minimap at the bottom, and needing an absolute value somewhere in here, or possibly that Chinchilla is not handling the viewport, but viewport is sort of voodoo for me. Let me know if there are experiments I should try to narrow it down.

commented

Turns out it was the "probably both" outcome that won. Grrr... 😠

commented

I think I fixed this in fa20daa... or made something else break, probably both. Give the latest alpha on CurseForge a go and let me know what happens.

commented

Huzzah, it is fixed. /cheers