mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
fix(ui): event initialization should clear uninitialized mouse data
Synthetic click events only set target/type/data, leaving mouse coordinates uninitialized. Zero the event before assigning fields so hit testing does not read undefined values.
This commit is contained in:
@@ -218,6 +218,7 @@ int ui_get_event_id(const char *event_name)
|
||||
|
||||
void ui_event_init(ui_event_t *e, const char *name)
|
||||
{
|
||||
memset(e, 0, sizeof(*e));
|
||||
e->target = NULL;
|
||||
e->type = ui_use_widget_event_id(name);
|
||||
e->cancel_bubble = false;
|
||||
|
||||
Reference in New Issue
Block a user