Skip to content

Path stroke gradients do not work as expected #5647

@johannes-wolf

Description

@johannes-wolf

Description

Tested with typst 0.12.0 (dhb06dbf9). On current master, drawing gradient strokes with path got fixed (with the new curve API): it is possible to stroke straight lines (angle 0deg) with a gradient now. But drawing the line flipped, does not flip the gradient (in contrast to line).

With line, the gradient gets reversed, if the end: is left of start:. Not sure if this is really a bug, or expected behaviour.

The following code:

#let red-blue = gradient.linear(red, blue, relative: "self")

// Ok
#path((0cm, 0cm), (5cm, 0cm), stroke: red-blue + 5pt)

// Expected blue to red gradient, got red to blue
#path((5cm, 0cm), (0cm, 0cm), stroke: red-blue + 5pt)

Results in this rendering:
grafik

Reproduction URL

No response

Operating system

Web app, Linux

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvisualizeRelated to the visualize category, which is about drawing and illustrating

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions