fix end line on non-consecutive ranges ending at the highest bit not being drawn #18

Merged
HEL merged 1 commits from ALVAROPING1/rivet-typst:dev into dev 2026-06-05 14:43:48 +00:00
Contributor

Previously, if you had a non-consecutive range that ended at the highest bit of the structure, such as:

#schema.render(
  schema.load(
    (
      structures: (
        main: (
          bits: 16,
          ranges: (
            "15-14": (name: "A"),
          ),
        ),
      ),
    ),
  ),
)

The end line of the range would not be drawn:
Screenshot_20260605_150441.png

With this change, it now gets correctly drawn:
Screenshot_20260605_150551.png

It also works correctly when ltr-bits is set, and also avoids drawing the line if it would be on top of the left/right borders of the structure

Previously, if you had a non-consecutive range that ended at the highest bit of the structure, such as: ```typst #schema.render( schema.load( ( structures: ( main: ( bits: 16, ranges: ( "15-14": (name: "A"), ), ), ), ), ), ) ``` The end line of the range would not be drawn: <img width="539" alt="Screenshot_20260605_150441.png" src="attachments/2fe6e155-baff-4c5d-989b-70eb7158ebf9"> With this change, it now gets correctly drawn: <img width="533" alt="Screenshot_20260605_150551.png" src="attachments/3b1ebdd6-d292-4ff7-ae99-b7de634351f9"> It also works correctly when `ltr-bits` is set, and also avoids drawing the line if it would be on top of the left/right borders of the structure
ALVAROPING1 added 1 commit 2026-06-05 13:08:08 +00:00
Owner

😬 This has already been fixed but I forgot to make a release...
See #13
I'll try making one in a couple of days

😬 This has already been fixed but I forgot to make a release... See #13 I'll try making one in a couple of days
HEL closed this pull request 2026-06-05 14:34:56 +00:00
Owner

My bad, there was still a bug indeed

My bad, there was still a bug indeed
HEL reopened this pull request 2026-06-05 14:38:29 +00:00
HEL approved these changes 2026-06-05 14:43:39 +00:00
HEL left a comment
Owner

Thanks for your contribution 👍

Thanks for your contribution 👍
HEL merged commit 05de90890f into dev 2026-06-05 14:43:48 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/rivet-typst#18