Handle null target in DragEvent (fix #4824)

This commit is contained in:
Martín Capello 2024-11-26 09:46:47 -03:00
parent ae9e3583a4
commit 58326b1508

View File

@ -20,7 +20,8 @@ namespace ui {
public:
DragEvent(Component* source, ui::Widget* target, os::DragEvent& ev)
: Event(source)
, m_position(ev.position() - target->bounds().origin())
, m_position((target ? ev.position() - target->bounds().origin()
: ev.position()))
, m_ev(ev) {}
bool handled() const { return m_handled; }