View Single Post
05-17-18, 02:26 PM   #10
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by galvin View Post
For some reason if the bags bar is moved to the left side. Blizzard has code that will set the scale really small on the main bar.

Someone must know how to work around this?
Lua Code:
  1. local availableSpace = MicroButtonAndBagsBar:GetLeft() - 16;
  2. scale = availableSpace / width;
  3. self:SetScale(scale);

It's in the quoted code. If the leftmost point of the microbar is on the left side of the rightmost point of the right gryphon, the bar will scale down, probably in a weird way since it's not expecting the negative offset to be that high. It's not "for some reason", it's because they're not expecting you to move the microbar to the left side.

Having that said, this piece of code isn't really top notch imo. They can solve this in a better way, and while beta is still on-going, maybe you should just ask Blizzard for a less hacky way to evaluate whether the two bars overlap.

Isn't it really just as easy as taking the space between the leftmost point of the left gryphon and the rightmost point of the right gryphon, adding it together with the width of the microbar and checking if it's the correct fraction of UIParent's total width? That way you would be able to put the microbar on the left side with ease.
__________________

Last edited by MunkDev : 05-17-18 at 02:34 PM.
  Reply With Quote