Skip to content

feat(scene): add Drawable input surface and masking-aware traversal - #127

Merged
isrcalebe merged 1 commit into
developfrom
feat/121-drawable-input-surface-traversal
Nov 18, 2026
Merged

isrcalebe merged 1 commit into
developfrom
feat/121-drawable-input-surface-traversal

Conversation

@isrcalebe

Copy link
Copy Markdown
Contributor

Summary

  • Add the scene input and focus surface to Drawable (AcceptsFocus, RequestsFocus, RequestsTextInput, HasFocus, IsHovered, IsDragged, HandlePositionalInput, HandleNonPositionalInput, ReceivePositionalInputAt, BuildPositionalInputQueue, BuildNonPositionalInputQueue), unified TriggerEvent/Handle dispatch, and protected virtual On* event hooks without reflection (IsAotCompatible).
  • Override BuildPositionalInputQueue and BuildNonPositionalInputQueue in CompositeDrawable to traverse InternalChildren in reverse Depth (front-to-back) order, skip disposed/Loading/!IsPresent subtrees, and enforce Masking clipping during positional traversal.
  • Add unit tests in DrawableInputTraversalTests and a NativeAOT smoke check in samples/aot-smoke.

Closes #121

Checklist

  • Labeled with one primary type label (feature, fix, docs, ci, chore, dependencies), plus breaking-change if applicable
  • Labeled with relevant area:* labels
  • Linked to an issue (Closes #121)
  • Public API changes are intentional (none, or listed below)
  • Tests added or updated
  • No new reflection or runtime code generation on the main path (NativeAOT-safe)

Public API changes

  • kajarlabs.Framework.Scene.Drawable:
    • AcceptsFocus, RequestsFocus, RequestsTextInput, HasFocus, IsHovered, IsDragged, HandlePositionalInput, HandleNonPositionalInput
    • ReceivePositionalInputAt(Vector2), BuildPositionalInputQueue(Vector2, List<Drawable>), BuildNonPositionalInputQueue(List<Drawable>)
    • Handle(UIEvent) and virtual event hooks (OnHover, OnHoverLost, OnMouseMove, OnMouseDown, OnMouseUp, OnClick, OnDoubleClick, OnDragStart, OnDrag, OnDragEnd, OnScroll, OnKeyDown, OnKeyUp, OnTextInput, OnFocus, OnFocusLost)
  • kajarlabs.Framework.Scene.CompositeDrawable:
    • Overrides BuildPositionalInputQueue(Vector2, List<Drawable>) and BuildNonPositionalInputQueue(List<Drawable>)

@isrcalebe isrcalebe added feature New functionality area:scene Drawables, containers, layout area:input Input handling and propagation labels Nov 18, 2026
@isrcalebe
isrcalebe merged commit 97b99af into develop Nov 18, 2026
4 of 5 checks passed
@isrcalebe
isrcalebe deleted the feat/121-drawable-input-surface-traversal branch November 18, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:input Input handling and propagation area:scene Drawables, containers, layout feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scene: Drawable input surface, positional hit-testing, and masking-aware traversal

1 participant