Open Mc-Zen opened 6 months ago
https://github.com/typst/typst/issues/3216#issuecomment-1897653191
it's reader's problem and wont appear in printer
https://github.com/typst/typst/issues/3216#issuecomment-1897653191
it's reader's problem and wont appear in printer
In this case it's png export, so not a reader problem.
It's a tricky issue though. Presumably due to float rounding.
#3216 (comment) it's reader's problem and wont appear in printer
In this case it's png export, so not a reader problem.
It's a tricky issue though. Presumably due to float rounding.
Maybe. But note that the same thin lines appears in svg and pdf export when using certain readers.
One trick is that you can draw it multiple times and the thin line will disappear.
#for i in range(5) {
for _ in range(5) {
place(dx: len * i, polygon-rect(width: len, height: len, fill: red, stroke: none))
}
}
https://discord.com/channels/1054443721975922748/1088371919725793360/1244280894227742781
This is related to anti alias rendering and is known as Conflation artifacts. For more please see https://github.com/linebender/vello/issues/49
Description
Consider the following code in which we display a series of rectangles using
rect
in the first line and an alike series of rectangles created withpolygon
.With
polygon
, a slight space appears between the tightly set rectangles.Note I have not discovered this on PDFs, it only seems to happen with PNG export. With SVGs, the story is different: here, both with
rect
andpolygon
, a slight space is left between consecutive rectangles.This may not seem as a great issue in itself but is indeed very annoying for many tasks such as general layout design, heatmaps, and more.
A (not very nice) workaround would be to add a very thin stroke. But how thin should the stroke be?
(Why use
polygon
instead ofrect
? The latter does not accept negative dimensions, see also #3265, this can be overcome withpolygon
).Reproduction URL
No response
Operating system
No response
Typst version