Skip to content

fix: Clip only the enabled FlClipData sides in line chart#2107

Open
martin-dehlan wants to merge 1 commit into
imaNNeo:mainfrom
martin-dehlan:fix/1262-clip-sides
Open

fix: Clip only the enabled FlClipData sides in line chart#2107
martin-dehlan wants to merge 1 commit into
imaNNeo:mainfrom
martin-dehlan:fix/1262-clip-sides

Conversation

@martin-dehlan

@martin-dehlan martin-dehlan commented Jun 14, 2026

Copy link
Copy Markdown

Description

LineChart's clipToBorder() built a single rect and passed it to clipRect, which always clips all four sides. Disabled sides were left at the canvas edge, so they still clipped overflow. As a result, enabling any single side in FlClipData clipped all four sides.

Disabled sides now extend to infinity, leaving them unbounded in clipRect; only the sides explicitly enabled in FlClipData get a real boundary. (Canvas.clipRect accepts infinite rects — its validity check only rejects NaN.)

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • [-] I have updated/added relevant documentation and added dartdoc comments with ///.
  • [-] I have updated/added relevant examples in example.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #1262

clipToBorder built a single rect and passed it to clipRect, which clips
all four sides. Disabled sides were left at the canvas edge, so they
still clipped overflow. Enabling any single side therefore clipped all
four sides.

Disabled sides now extend to infinity so clipRect leaves them unbounded;
only the sides enabled in FlClipData get a real boundary.

Fixes imaNNeo#1262

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@martin-dehlan martin-dehlan changed the title fix: clip only enabled FlClipData sides in line chart (#1262) fix: Clip only the enabled FlClipData sides in line chart Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Whenever any clip side is true, all sides are clipped

1 participant