GithubHelp home page GithubHelp logo

Comments (4)

mavanpee avatar mavanpee commented on August 24, 2024

I resolved this on my own download. It's because the underlying gradient isn't drawn correctly, as you can see the red section is much larger than the blue, but they should be equal in length. It's a lot more noticeable if you increase the stroke width to something like 20+.

Luckily it's fixed with one line change.

In the _CirclePickerPainter class in flutter_circle_color_picker.dart, the class responsible for drawing the circle and it's gradient, change the createShader lines as follows (commented our old line in favour of the new one). Note that to avoid conflicts, I had to rename the "center" variable in this class to be called "circleCenter" instead. Here's the change:

        final sweepShader = sweepGradient.createShader(
            // Rect.fromLTWH(0, 0, radio, radio),                  // --> OLD line
            Rect.fromCircle(center: circleCenter, radius: radio),  // New Line; changed "centre" to "circleCenter"
        );

from flutter_circle_color_picker.

itome avatar itome commented on August 24, 2024

@mavanpee Thank you! Would you make PR to fix this?

from flutter_circle_color_picker.

mavanpee avatar mavanpee commented on August 24, 2024

Hehe.. I'll be completely honest with you, one of the reasons I was being so descriptive in my post is because I have absolutely no idea how to do a PR myself. I've never really used github before.

from flutter_circle_color_picker.

itome avatar itome commented on August 24, 2024

Thanks, I created PR and merged.
#10

from flutter_circle_color_picker.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.