Skip to content

Documentation needs update for non-dictionary style overrides #982

Description

@P4ntomime

Problem Description

Per the example for styling, non-dictionary values for styles should override globally defined styles.
It appears as though the bug was introduced with version 0.4.2, as the behavior is still correct with version 0.4.1.
Edit: This has been changed in version 0.4.2 and the documentation should be updated to reflect this change.

Example

// Sets the stroke to red with a thickness of 5pt
set-style(stroke: (paint: red, thickness: 5pt))

// Draws a line with the global stroke
line((0,0), (1,0))

// Draws a blue line with a thickness of 5pt because dictionaries update the style
line((0,0), (1,1), stroke: (paint: blue))

// Draws a yellow line with a thickness of 1pt because other values override the style
line((0,0), (0,1), stroke: yellow)

The expected previous output should be
Image
(produced with CeTZ version 0.4.1)

However, since version 0.4.2, the produced output is
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions