Skip to content

CGGradient's Edge-Location Parameters Produce Incorrect Results #2553

Open

Description

CGGradient seemingly ignores the values passed in for location or uses them incorrectly. For the below image, the color components are from Red -> Black -> Red. The locations are specified as {0.0, 0.4, 0.7} meaning there should be a black band in the middle of two red blocks while the red extends out to the end of the rectangle afterwards. Finally, the starting and end points are the bottom left and top right of the rectangle respectively.

image

Similar issues can be seen when setting the locations to {0.3, 0.5, 1.0}. There should be leading red space, but alas, there is not.

image

I talked with @msft-Jeyaram about this, and it seems to be an implementation bug. He seems to understand the issue. Test collateral for specifying different start and end points via the locations[] parameter should be added.

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions