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

maskColor is displayed beyond the imageRect inside of a Stack #104

Open
Azhng opened this issue Jun 12, 2023 · 3 comments
Open

maskColor is displayed beyond the imageRect inside of a Stack #104

Azhng opened this issue Jun 12, 2023 · 3 comments

Comments

@Azhng
Copy link

Azhng commented Jun 12, 2023

When rendering the Crop widget inside of a Stack widget, the maskColor fills the parent Stack widget instead of displaying the underlying color of the parent widget.

IMG_3089B13072C7-1

Code sample:

class _Body extends StatelessWidget {
  const _Body({Key? key, required this.bytes}) : super(key: key);
  final UInt8List bytes;

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (_, constraints) {
        return Scaffold(
          backgroundColor: Colors.white,
          body: Stack(
            children: [
              Align(
                alignment: Alignment.center,
                child: Padding(
                  padding: const EdgeInsets.all(24),
                  child: Crop(
                    controller: CropController(),
                    image: bytes,
                    onCropped: (croppedData) {},
                    aspectRatio: 1,
                    initialSize: 1.0,
                    cornerDotBuilder: (size, _) => const DotControl(),
                    baseColor: AppColors.scaffoldBackgroundColor,
                  ),
                ),
              ),
            ],
          ),
        );
      },
    );
  }
}

Azhng added a commit to peggyart/crop_your_image that referenced this issue Jun 12, 2023
@chooyan-eng
Copy link
Owner

@Azhng
Thank you for your feedback.
I'm afraid fixing this is challenging as the size of images (and outside of images) can be changed depending on zooming. I'll check the code and think about it in detail.

@Azhng
Copy link
Author

Azhng commented Jun 30, 2023

Thank you so much!

@geosebas
Copy link

geosebas commented Feb 5, 2024

Any news on this ?

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

3 participants