diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp index 755e3ceb1..a51387848 100644 --- a/src/interface/Label.cpp +++ b/src/interface/Label.cpp @@ -121,6 +121,17 @@ void Label::OnMouseMoved(int localx, int localy, int dx, int dy) } } +void Label::Tick(float dt) +{ + if(!this->IsFocused() && (selecting || (selectionIndex0 != -1 && selectionIndex1 != -1))) + { + selecting = false; + selectionIndex0 = -1; + selectionIndex1 = -1; + updateSelection(); + } +} + void Label::updateSelection() { std::string currentText; diff --git a/src/interface/Label.h b/src/interface/Label.h index e154c0e51..34822bb42 100644 --- a/src/interface/Label.h +++ b/src/interface/Label.h @@ -51,6 +51,7 @@ namespace ui virtual void OnMouseUp(int x, int y, unsigned button); virtual void OnMouseMoved(int localx, int localy, int dx, int dy); virtual void Draw(const Point& screenPos); + virtual void Tick(float dt); }; }