frozn / TipTac

WoW AddOn TipTac Reborn
GNU General Public License v3.0
108 stars 20 forks source link

Conflict with "SavedInstances" Addon #205

Closed Rhynox closed 1 year ago

Rhynox commented 1 year ago

I use the Addon "SavedInstances" (in combination with Titan Panel). This Addon offers a feature to rescale its Tooltip. Since the latest version of "TipTac Reborn" the scale there doesn't work anymore, and the "Fit to screen" (automatic scale) feature causes serious frame drops. This only happens when TipTac Reborn is enabled. This did not happen in earlier versions of your Addon, so maybe you changed something that is now in conflict with "SavedInstances".

I don't know if this issue can be solved by you or has to be tackled by the "SavedInstances" author as well, but I thought I'd let you know.

Keep up the great work!

frozn commented 1 year ago

Thanks for reporting this! 👍

I have found the problem: If the tooltip exceeds the screen width/height, addon SavedInstances sets a new scale, hides the tip and shows it again with the next screen refresh. But TipTac overrides the scale in the show event to apply TipTac's scale again. So the tip will again be rescaled by SavedInstances and so on... an infinite loop.

To prevent this I added a check in TipTac too to consider the situation if the tip exceeds the screen width/height to reduce the scaling appropriately.

Working fine on my side now. The fix will be included in the next release.

Rhynox commented 1 year ago

Thanks a lot for looking into this.

LiangYuxuan commented 1 year ago

Hi, this issue is still exists with huge SavedInstaces tooltip. https://github.com/SavedInstances/SavedInstances/issues/696 have the wtf data file of SavedInstances to reproduce it.

You can use the data file and disable Fit to Screen of SavedInstances, and found the tooltip is too huge under the scale of TipTac.

frozn commented 1 year ago

This was a tricky one. Previously I adopted the scaling part from addon SavedInstances, but regarding the tooltip library LibQTip it's necessary to call LibQTip.layoutCleaner:CleanupLayouts() too before evaluating the width/height of the tooltip, because it can change afterwards otherwise. This call is included in SI, but I considered it unnecessary for the scaling part when I took this over. But unfortunately regarding LibQTip it's not. 🙂

After adding this call to TipTac, the very wide tooltip based on the supplied wtf data file scales nicely.

Here's the dev version:

TipTac-dev.zip

Some additional words regarding the scaling feature in TipTac:

One of TipTac's features is to offer scaling for tooltips. Various addons are using the library LibQTip to easily create tooltips. But the question is: How can TipTac "know" which tooltips from LibQTip should be scaled for better readability and which not (e.g. because the tooltip will be scaled by the foreign addon itself like in SI)? Disabling adjusting the scale for all tooltips coming from LibQTip doesn't seem to be a good solution. So I decided to add the rescaling for tooltips wider/higher than the screen of SI, because it's anyway a good idea to do this.

artazika commented 1 year ago

Wow! Yeah, it works! Thank you both for solving this problem, cheers

Rhynox commented 1 year ago

Just tested the DEV version, works fine for me too now. Thank you!