3 Commits

Author SHA1 Message Date
ALVAROPING1
9b83b4c4a8 fix end line on non-consecutive ranges ending at the highest bit not being drawn 2026-06-05 14:45:34 +02:00
df7899ee4b Merge pull request 'prevent drawing separators on starting lines of fields' (#17) from rajayonin/rivet-typst:fix-consecutive-ranges into dev
Reviewed-on: #17
Reviewed-by: Louis Heredero <louis@herdac.ch>
2025-11-28 11:37:43 +00:00
b6f2fd99b8 prevent drawing separators on starting lines of fields
On non-consecutive ranges, we were drawing the starting line _on top_ of
the separator, which lead to some visual glitches in some viewers.
2025-11-25 09:02:49 +01:00

View File

@@ -387,8 +387,10 @@
}
let range-boundaries = ()
for r in struct.ranges.values() {
let i = to-real-i(if config.ltr-bits {r.start} else {r.end})
range-boundaries.push(i)
let start-i = to-real-i(if config.ltr-bits {r.start} else {r.end})
let end-i = to-real-i(if config.ltr-bits {r.end} else {r.start}) + 1
range-boundaries.push(start-i)
range-boundaries.push(end-i)
}
// Draw colors
@@ -472,9 +474,9 @@
shapes += draw-text(range_.name, txt-col, name-x, name-y, fill: bg-col)
// paint end line only if needed
let is-not-limit = if config.ltr-bits { start-i != 0 } else { end-i != struct.bits - 1 }
if (
start-i != 0
and end-i != struct.bits - 1
is-not-limit
and ranges
.at(
i