Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Consider using self:GetWidth instead of self:GetSize in Display:CalculateSizeRatio #22

Open
vomaufgang opened this issue Sep 21, 2020 · 2 comments

Comments

@vomaufgang
Copy link

Back in version 7.2.0 the font size for any given cooldown was calculated based on the width of the icon it was displayed on:

function Timer.OnSizeChanged(self, width, height)
	local fontScale = round(width) / ICON_SIZE

ad0dff9 changed the calculation to use the icons size via GetSize instead:

function Display:CalculateSizeRatio()
    local sizeRatio = round(min(self:GetSize())) / ICON_SIZE

GetSize however causes the calculation to use the icons height instead.

The cooldown icons above the floating enemy health bars are much wider than they are high - in my case 20 wide by 14 high.

The old calculation using width resulted in a sizeRatio of ca. 20 / 36 = 0.55, which was quite readable:

grafik

The new calculation however leads to a sizeRatio of ca. 14 / 36 = 0.38, making the font way too small imho:

grafik

Would it be possible to change the calculation so the icons width / self.GetWidth() is used to determine the font size (again)?

Square icons would be unaffected by this change and to my knowledge there are no other non square icons with cooldowns in the game.

Thanks in advance for your time!

@Tuller
Copy link
Member

Tuller commented Sep 21, 2020

You probably just want to switch min to max.

@vomaufgang
Copy link
Author

You're right, didn't even see that min. Talk about standing in the forest being blind to the trees.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants