static void OnTooltip(TooltipEvent e, string tooltip) { VisualElement element = e.currentTarget as VisualElement; if (element != null) { e.rect = element.worldBound; } e.tooltip = tooltip; e.StopImmediatePropagation(); }
static void OnTooltip(TooltipEvent e) { VisualElement element = e.currentTarget as VisualElement; if (element != null && !string.IsNullOrEmpty(element.tooltip)) { e.rect = element.worldBound; e.tooltip = element.tooltip; e.StopImmediatePropagation(); } }