Skip to content

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Jan 31, 2026

Summary

Adds Gesture Events types for Vello-style per-frame gesture recognition.

Added

  • GestureEvent struct with:

    • NumPointers - active touch points count
    • ZoomDelta - proportional zoom (1.0 = no change)
    • ZoomDelta2D - non-proportional zoom (stretch)
    • RotationDelta - rotation in radians
    • TranslationDelta - pan movement
    • PinchType - classification (horizontal/vertical/proportional)
    • Center - centroid of touch points
    • Timestamp - event time
  • PinchType enum with:

    • PinchNone - default
    • PinchHorizontal - horizontal separation > 3x vertical
    • PinchVertical - vertical separation > 3x horizontal
    • PinchProportional - uniform zoom
  • Point type with Add(), Sub(), Scale() operations

  • GestureEventSource interface with OnGesture(fn func(GestureEvent))

  • NullGestureEventSource for platforms without gesture support

Tests

  • TestGestureEvent_ZeroValue
  • TestGestureEvent_Fields
  • TestNullGestureEventSource

Related Issues

Test Plan

  • All tests pass
  • Lint passes (0 issues)
  • Code formatted

Vello-style per-frame gesture recognition:
- GestureEvent struct with zoom/rotation/translation deltas
- PinchType enum (Horizontal, Vertical, Proportional)
- Point type with Add/Sub/Scale operations
- GestureEventSource interface with OnGesture callback
- NullGestureEventSource for platforms without gesture support
- Comprehensive unit tests
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit ab17f9c into main Jan 31, 2026
10 checks passed
@kolkov kolkov deleted the feat/EVENT-004-gesture-events branch January 31, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants