|
|
|
|
|
|
SendPointerEventWithData(event); |
|
|
|
} |
|
|
|
|
|
|
|
void UIWidgetsPanel::SendScroll(float delta_x, float delta_y, float px, float py) { |
|
|
|
UIWidgetsPointerEvent event = {}; |
|
|
|
// TODO: this is a native method, use unity position instead. |
|
|
|
event.x = px; |
|
|
|
event.y = py; |
|
|
|
SetEventPhaseFromCursorButtonState(&event); |
|
|
|
event.signal_kind = UIWidgetsPointerSignalKind::kUIWidgetsPointerSignalKindScroll; |
|
|
|
// TODO: See if this can be queried from the OS; this value is chosen |
|
|
|
// arbitrarily to get something that feels reasonable. |
|
|
|
const int kScrollOffsetMultiplier = 20; |
|
|
|
event.scroll_delta_x = delta_x * kScrollOffsetMultiplier; |
|
|
|
event.scroll_delta_y = delta_y * kScrollOffsetMultiplier; |
|
|
|
SendPointerEventWithData(event); |
|
|
|
} |
|
|
|
|
|
|
|
void UIWidgetsPanel::SendPointerEventWithData( |
|
|
|
const UIWidgetsPointerEvent& event_data) { |
|
|
|
MouseState mouse_state = GetMouseState(); |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void UIWidgetsPanel::OnScroll(float x, float y, float px, float py) { |
|
|
|
if (process_events_) { |
|
|
|
SendScroll(x, y, px, py); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//_Wait |
|
|
|
panel->ProcessMessages(); |
|
|
|
} |
|
|
|
|
|
|
|
UIWIDGETS_API(void) |
|
|
|
UIWidgetsPanel_onScroll(UIWidgetsPanel* panel, float x, float y, float px, float py) { |
|
|
|
panel->OnScroll(x, y, px, py); |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace uiwidgets |