Is there a way to know when an element has finished resizing so that it can be conditionally positioned?
I need to display a dynamic tooltip (a custom VisualElement) on top of an item, but before displaying I need to measure the tooltip height to make sure it fits in the available space.
My current solution is:
tooltip.style.opacity = 0;
tooltip.Show();
tooltip.Render(Data);
tooltip.schedule.Execute(() => {
tooltip.SetPosition(worldBound);
tooltip.style.opacity = 1;
}).ExecuteLater(1);
It works but sometimes there’s a flicker
Is there a better way?
Thanks