Skip to content

Converting between fill argument and fill structure #3700

@PaulWessel

Description

@PaulWessel

In dealing with issue #3696 I found another problem in how the fill syntax works. In the coast version tested in #3696 I build input for psxy to plot DCW polygons instead of doing it polygon by polygon because of the hole issue. It fails for ex34 because I parse the pattern argument +gP300/8 and it gets stored in a GMT_FILL struct. However, when I want to do the reverse (write what the structure holds back to a string) it gives me p300/8; notice the lower-case p. Per our documentation

By specifying upper case -GP instead of -Gp the image will be bit-reversed

so while since the p is now P we lost that bit of information.

Internally, when p300/8 is parsed we check for p and if it is p we bit-reverse the image. This seems to contradict the documentation but that might just be an internal thing. However, if that is true then we should write P300/8 on the output, not p. So this is a bit messy but it is clearly a bug that would never be found without the DCW issue! I note that once the image is bit-reversed there is no information left that this occurred. All we know is it is pattern number 8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions