Kaynağa Gözat

Fix escalating UI element priority due to tooltip / popup forcing themselves to max. priority. Closes #154.

Lasse Öörni 12 yıl önce
ebeveyn
işleme
c162f2ebf6
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      Source/Engine/UI/UIElement.cpp

+ 3 - 0
Source/Engine/UI/UIElement.cpp

@@ -1076,6 +1076,9 @@ void UIElement::BringToFront()
         if (other->IsEnabled() && other->bringToBack_ && other != ptr)
         if (other->IsEnabled() && other->bringToBack_ && other != ptr)
         {
         {
             int priority = other->GetPriority();
             int priority = other->GetPriority();
+            // M_MAX_INT is used by popups and tooltips. Disregard these to avoid an "arms race" with the priorities
+            if (priority == M_MAX_INT)
+                continue;
             usedPriorities.Insert(priority);
             usedPriorities.Insert(priority);
             maxPriority = Max(priority, maxPriority);
             maxPriority = Max(priority, maxPriority);
         }
         }