HydraUI

HydraUI

841k Downloads

inappropriate vUI:SetScale()

cjhwang0222 opened this issue ยท 0 comments

commented

function vUI:SetScale(x)
self:UpdateScreenSize()
self.UIParent:SetScale((768 / ScreenHeight) / min(1.2, max(0.4, x)))
end

function vUI:GetSuggestedScale()
return (768 / ScreenHeight)
end

I reported it on Discord but it seemed that it got no attention so I report it here again.

self.UIParent:SetScale((768 / ScreenHeight) / min(1.2, max(0.4, x)))

This line has a problem. When I use the suggested scale, it is actually divided by itself (768 / ScreenHeight) in this line. So the actual scale is always set as 1, unless the suggested scale is less than 0.4.

In my case, I'm using iMac 5k so the ScreenHeight is 2880. So the suggested scale is about 0.2666 which is smaller than 0.4. So the actual scale is set as about 0.666 (= 0.2666 / 0.4) by the line above.

When I'm trying to set the scale manually, the bigger scale I input, the smaller scale is set. Because, the input is used as denominator not as nominator which is always the suggested value though.