Skip to content

Introduce scene node definitions for rendering and hits#133

Merged
kostyafarber merged 5 commits into
mainfrom
scene-node-pass-rendering
Jul 5, 2026
Merged

Introduce scene node definitions for rendering and hits#133
kostyafarber merged 5 commits into
mainfrom
scene-node-pass-rendering

Conversation

@kostyafarber

Copy link
Copy Markdown
Collaborator

Summary

This PR starts moving scene behavior behind node definitions instead of hard-coding glyphs in editor/rendering paths.

  • Adds NodeDefinition registration and moves glyph pointer hit-testing into GlyphNodeDefinition.
  • Adds RenderContext so renderer-owned resources, including the marker layer, flow through frame dispatch instead of being retained by scene-layer helpers.
  • Adds marker frame begin/commit lifecycle so stale marker draws are cleared by the renderer pipeline.
  • Renames root canvas drawing setup from glyph space to scene space.
  • Moves glyph outline, debug, segment, control-line, handle, and anchor rendering into GlyphNodeDefinition.
  • Makes NodeObject.bounds() forward to the registered node definition.

Why

Text, image, and plugin-defined nodes should not require editing SceneLayer, BackgroundLayer, or Editor.getPointerTarget for basic draw/hit behavior. This keeps render pass ordering in the renderer while letting node kinds own their content and internal chrome.

Follow-up

Marker placement still has one asymmetry: CPU handle drawing inherits placement from the canvas transform stack, while GPU marker drawing receives the glyph node offset through Handles.draw(ctx, node, ...). The intended follow-up is a marker transform/offset capability so canvas and marker placement share the same transform discipline before issue #129 lands node transforms.

Validation

  • pnpm format:check
  • pnpm lint:check
  • pnpm typecheck
  • pnpm build:native:debug && pnpm --filter @shift/desktop test
  • Manual smoke test in the app: open glyph, render glyph/chrome, and interact with hover/selection/drag paths.

@kostyafarber kostyafarber marked this pull request as ready for review July 5, 2026 15:26
@kostyafarber kostyafarber merged commit b065478 into main Jul 5, 2026
11 of 12 checks passed
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.

1 participant