cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
733 stars 34 forks source link

bug: Stylistic change in the presence of `reflow: true` #626

Closed tingerrr closed 2 weeks ago

tingerrr commented 2 weeks ago

The presence of reflow: true with a non-zero angle on rotate inside a cetz.canvas seems to affect styles, notice how the stroke of the box is only on one side.

#import "@preview/cetz:0.2.2"

#let ex = (
  (true, 45deg),
  (true, 0deg),
  (false, 45deg),
  (false, 0deg),
)

#let rot(reflow, angle, body) = rotate(
  reflow: reflow,
  angle,
  box(stroke: red, body)
)

#table(columns: 4,
  table.header[regular][cetz][reflow][angle],
  ..ex.map(ex => (
    rot(..ex)[AAA],
    cetz.canvas(cetz.draw.content((0, 0), rot(..ex)[AAA])),
    ..ex.map(x => [#x]),
  )).flatten()
)

image

tingerrr commented 2 weeks ago

Seems this is caused by typst#4237 and therefore strictly upstream.