Selaa lähdekoodia

removed handlingDragAndDrop_ variable, get drag object directly

rsredsq 10 vuotta sitten
vanhempi
sitoutus
7264e3976e
2 muutettua tiedostoa jossa 3 lisäystä ja 9 poistoa
  1. 3 7
      Source/Atomic/UI/UISelectList.cpp
  2. 0 2
      Source/Atomic/UI/UISelectList.h

+ 3 - 7
Source/Atomic/UI/UISelectList.cpp

@@ -227,11 +227,6 @@ void UISelectList::HandleUIUpdate(StringHash eventType, VariantMap& eventData)
                 select->GetScrollContainer()->ScrollBy(0, speed);
                 select->GetScrollContainer()->ScrollBy(0, speed);
 
 
         }
         }
-        handlingDragAndDrop_ = true;
-    }
-    else
-    {
-        handlingDragAndDrop_ = false;
     }
     }
 
 
 }
 }
@@ -244,8 +239,10 @@ bool UISelectList::OnEvent(const tb::TBWidgetEvent &ev)
     }
     }
     if (ev.type == EVENT_TYPE_POINTER_MOVE)
     if (ev.type == EVENT_TYPE_POINTER_MOVE)
     {
     {
+        UIDragDrop* dragDrop = GetSubsystem<UIDragDrop>();
+
         //if we handle drag and drop then return true, to avoid panning scroll widget by turbobadger, let the widget control scroll by itself
         //if we handle drag and drop then return true, to avoid panning scroll widget by turbobadger, let the widget control scroll by itself
-        if (handlingDragAndDrop_)
+        if (dragDrop->GetDraggingObject())
             return true;
             return true;
     }
     }
     return UIWidget::OnEvent(ev);
     return UIWidget::OnEvent(ev);
@@ -276,5 +273,4 @@ void UISelectList::SetUIListView(bool value)
 
 
 }
 }
 
 
-
 }
 }

+ 0 - 2
Source/Atomic/UI/UISelectList.h

@@ -77,8 +77,6 @@ protected:
     virtual bool OnEvent(const tb::TBWidgetEvent &ev);
     virtual bool OnEvent(const tb::TBWidgetEvent &ev);
 
 
 private:
 private:
-    //Returns true if we have drag and drop element on select list widget
-    bool handlingDragAndDrop_;
 };
 };