Repository navigation
docs: note drawButton hit-tests in window coordinates - #55
Merged
Merged
Conversation
The docstring and README stated the clickable region is exactly the drawn box. That only holds when the Graphik is bound to the display itself: pygame.mouse.get_pos() is window-relative, so for a subsurface or an off-screen surface the box is painted at the surface's offset while the clickable region stays at the raw (xpos, ypos). Document that, and pin it with a characterization test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline during a headless dispatch, not an independent review):
Judgment call flagged for a maintainer: whether Do-not-auto-merge path check: no workflow, This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage A (documentation accuracy sweep) cycle.
drawButton's docstring and the README both stated that the clickable region is "exactly the region the box is drawn over". That only holds when theGraphikis bound to the display itself. The hit test comparespygame.mouse.get_pos(), which is window-relative, against(xpos, ypos)unchanged. As a result, when the instance is bound to a subsurface (or to an off-screen surface that is later blitted somewhere other than the window origin), the box is painted at the surface's offset but stays clickable at the raw(xpos, ypos)in window coordinates.graphik.py: a paragraph was added to thedrawButtondocstring describing the window-coordinate hit test. No code was changed.README.md: thedrawButtonentry now carries the same qualification.test_graphik.py: a new characterization test,test_draw_button_hit_tests_in_window_coordinates_not_the_bound_surface, binds aGraphikto a subsurface offset by (100, 100). It asserts that a press over the painted box does not fire and that a press at the raw window coordinates does. Each case is backed by a pixel check, so the test is tied to what is actually drawn.This is a docs-and-test change only, and the behavior is deliberately left as it is. Translating the mouse position into the bound surface's coordinates would change behavior for the vendored consumers (Roam, Apex, Ophidian, Patchwork, Tic-Tak-Toe), so that decision belongs to a maintainer and is out of scope for a docs cycle. No public member changed, so the consumer-impact gate does not apply.
No tracking issue: the gap was found during the documentation sweep.
Skipped issues
None of the open issues was taken up this cycle, because each one waits on a human:
.github/workflows/, which is excluded from autonomous change. release: version tags are pushed without the 'v' prefix publish.yml requires, so no release has ever been published #34 also needs a maintainer decision on tagging.preponderous.*namespace convention used across sibling projects.Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest: 67 passed (66 existing + 1 new), headless via the conftest dummy SDL driversThis PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson