Repository navigation
test: pin that draws crossing the surface edge are clipped, not shifted - #58
Merged
Merged
Conversation
Nothing pinned what happens when a draw method is handed a position that puts part of the shape off the surface, which consumers scrolling a tiled view rely on every frame. Add characterization tests for every edge across drawRectangle, drawImage and drawButton, plus drawText centered on a corner, and document the clipping in the class docstring and README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A size-24 "W" renders 23x24, so the hard-coded bound of 12 sat one pixel from the limit and its comment overstated the glyph's size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (posted as a plain comment; Copilot reviewer could not be added —
Two findings were fixed mechanically; no judgment calls remain open. 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 B (unit-test expansion) for off-surface drawing, with the matching doc addition.
test_draw_methods_clip_a_shape_that_crosses_the_surface_edgeis added, parametrized overdrawRectangle,drawImageanddrawButton(empty label) × all four corners (-5/15offsets of a 10×10 shape on a 20×20 display). Every pixel of the display is checked: inside the clipped intersection it carries the drawn color, and everywhere else it stays black.test_draw_text_centered_on_a_surface_corner_paints_the_visible_partis added. It centers a size-24"W"on(0, 0)and requires ink to be painted, all of it inside the quadrant around the corner.Graphikclass docstring and to the README's public-method section.No production behavior is changed. The docstring edit is comment-only, and no public signature is touched, so no consumer-impact check applies.
No tracking issue — gap found during triage.
Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest(headless viaconftest.py): 82 passed (69 previously plus 13 new)max(0, …)indrawRectangle,clamp_ipto the surface indrawText,min(xpos, 10)indrawImage). 9 of the 13 new tests failed. The 4 that passed are the cases a given clamp cannot affect. The source was then restored, and all 82 tests passed.Deferred issues
.github/workflows/or to the release/tagging process, both excluded from autonomous change.preponderous/__init__.pydepends on a maintainer decision about the namespace convention used by siblingpreponderous.*projects, which cannot be settled from this repository.This 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