Skip to content

Inconsistency between conic gradients in PNG/SVG and PDF #7890

@saecki

Description

@saecki

Description

Discord thread: https://discord.com/channels/1054443721975922748/1239578999664152699/1473376620550291559

With the switch to krilla, the way conic gradients in PDF adapt to the container aspect ratio has changed:

0.13 0.14/main
Image Image
Source code
#grid(
  columns: 2,
  gutter: 5pt,
  rect(width: 70pt, height: 70pt, fill: gradient.linear(angle: 135deg, ..color.map.turbo)),
  rect(width: 25pt, height: 70pt, fill: gradient.linear(angle: 135deg, ..color.map.turbo)),
  rect(width: 70pt, height: 25pt, fill: gradient.linear(angle: 135deg, ..color.map.turbo)),
)

#grid(
  columns: 2,
  gutter: 5pt,
  rect(width: 70pt, height: 70pt, fill: gradient.conic(angle: 135deg, ..color.map.turbo)),
  rect(width: 25pt, height: 70pt, fill: gradient.conic(angle: 135deg, ..color.map.turbo)),
  rect(width: 70pt, height: 25pt, fill: gradient.conic(angle: 135deg, ..color.map.turbo)),
)

#grid(
  columns: 2,
  gutter: 5pt,
  rect(width: 70pt, height: 70pt, fill: gradient.radial(..color.map.turbo)),
  rect(width: 25pt, height: 70pt, fill: gradient.radial(..color.map.turbo)),
  rect(width: 70pt, height: 25pt, fill: gradient.radial(..color.map.turbo)),
)

The output of PNG and SVG aligns with the 0.13 PDF, and the different export formats should be visually the same. The question is what behavior we actually want.

Was the old behavior intentional? Because it seems like aspect ratio correction is applied in reverse. If no correction was applied at all, the 45deg angle should exactly meet the corner of the container.

Pinging @LaurenzV @Dherse (feel free to ignore if you're buisy)

Operating system

No response

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 illustratingwaiting-on-designThis PR or issue is blocked by design work.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions