Skip to content

CPDF rounded clipping path adds a diagonal across the shape #3785

Description

@dajiaohuang

Cpdf::clippingRectangleRounded() builds the path around all four rounded corners, then after the top-left arc ends at the starting point (the left edge at y1 + h - rTL) it emits one more line to ($x1 + $rBL, $y1) before applying W n:

// after the top-left arc
$this->addContent(sprintf("\n%.3F %.3F l ", $x1 + $rBL, $y1));
$this->addContent(" W n");

That line crosses the clipped area diagonally from the top-left side to the bottom-left corner. With unequal corner radii it is especially clear, but it is present for all radii. The path should close along the rectangle's intended boundary without this extra diagonal.

Static source finding; no render test was run.

Activity

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

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