Improve X-Axis Generation - #39
Merged
Merged
Conversation
Merged
Lexer747
pushed a commit
that referenced
this pull request
Jul 19, 2026
I noticed on #39 that CI didn't run because the base branch was `main`, this was the opposite of what it was supposed to do. I think I originally got my `and` and `or` mixed up.
Synthace-Alex-Lewis
force-pushed
the
synthace-dev
branch
2 times, most recently
from
July 19, 2026 21:48
b5199fb to
24fe7cb
Compare
Owner
|
The following test cases do not look good. More work to do here. |
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.
Fixes #18
There was a few gotchas in the x-axis code I'd missed:
followingthe origin padding and spans were over counted resulting in x-axis which were using too much space.remainingvariable only decremented when a span was actually drawn, meaning the final span would not actually have any space left results in unused space.This PR fixes the spans by properly de-coupling the allocation of spans to the tracking variable of the "budget" that is then allocated.
cursorXis the new tracking variable which works in a similar way but with the new helperwritePadding/xAxisDrawTimesit's now a subtle inversion of control that ensures that thespan.Widthis the source truth only done once and when written to the buffers it does not spill over it's allocation.The following issue is fixed by the dedicated branch which now has a new comment:
// startX/endX drive plotting (full terminal), width drives label layout (drawable area only).thus ensuring that span actually takes up the space it's allowed (accounting for the origin) instead of the raw terminal size.
Adds new tests for the
followingcases since it's clearly an area for regression.