Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improve] Wrap CustomPaint in ClipRect to respect the boundaries #17

Open
rodolfogoulart opened this issue May 2, 2023 · 1 comment

Comments

@rodolfogoulart
Copy link

Just wrap you CustomPaint in a ClipRect, so when displayed on some widget dont go beyond the boundaries.

In my case, using the Stack with the property fit = StackFit.expand has a good result too in the screen

@override
  Widget build(BuildContext context) => Stack(
        fit: StackFit.expand,
        children: [
          widget.child,
          IgnorePointer(
            child: ClipRect(
              child: CustomPaint(
                foregroundPainter: _ArrowPainter(
                  _elements,
                  Directionality.of(context),
                  [this, ...widget.listenables],
                ),
                child: Container(),
              ),
            ),
          ),
        ],
      );

Example
image

@Schwusch
Copy link
Owner

Schwusch commented May 2, 2023

Hey, thanks for the input! Can I ask you for a pull request with the changes you want?

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

No branches or pull requests

2 participants