Skip to content

Remove unused TreemapHitTester and dedupe hit testing - #16

Merged
phalladar merged 1 commit into
mainfrom
chore/remove-hit-tester
Oct 3, 2026
Merged

phalladar merged 1 commit into
mainfrom
chore/remove-hit-tester

Conversation

@phalladar

Copy link
Copy Markdown
Owner

Summary

  • Removes TreemapHitTester from TreemapLayout.swift. It was never instantiated. Hit testing moved into TreemapView when zoom and pan were added (061ca7a), since it needs the screen-to-content transform first, and this struct was left behind.
  • Dedupes TreemapView's hit testing. hitTestID(at:) and hitTestItem(at:) were two copies of the same reverse loop. hitTestID now returns hitTestItem(at:)?.id, and hitTestItem uses items.last(where:). It finds the same item as before (the deepest one, drawn on top), so hover, selection and drill-down don't change.

Testing

  • swift build passes, and nothing references the removed struct.
  • A build stamped as SDK 26.5 passes scripts/smoke-test.sh.

🤖 Generated with Claude Code

TreemapHitTester was never instantiated: hit testing moved into
TreemapView when zoom and pan were added, because it needs the screen to
content transform first. TreemapView then had two copies of the same
reverse-order lookup. hitTestID now calls hitTestItem, which uses
items.last(where:) and returns the same item as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phalladar
phalladar merged commit 40b7576 into main Oct 3, 2026
1 check 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