Giter Site home page Giter Site logo

Comments (4)

jwiggins avatar jwiggins commented on June 19, 2024

Thanks for the report! It's a good question whether this is a bug or a feature. It's certainly confusing, so I would lean towards bug. Looking at the C++ code clarified things a bit for me.

Basically, passing None is not the way to achieve the result you want. Rather, you should set state.drawing_mode = celiagg.DrawingMode.DrawFill or state.drawing_mode = celiagg.DrawingMode.DrawStroke. It just so happens that DrawingMode.DrawFillStroke is the default, and passing None for fill or stroke results in celiagg.SolidPaint(0,0,0) being passed through to the underlying C++ code.

Do you think a descriptive exception would help here if the drawing mode is "incompatible" with the given stroke/fill paint?

from celiagg.

zpincus avatar zpincus commented on June 19, 2024

Alternately, perhaps the default could be celiagg.SolidPaint(0,0,0) instead of None? That might clarify thing. (An addition to the docstring mentioning the use of DrawingMode to disable fill / stroke would also be helpful.)

Or is there a reason that None is necessary instead of a specific paint default?

from celiagg.

jwiggins avatar jwiggins commented on June 19, 2024

I've updated the documentation. The docstrings now reflect better what is happening internally.

from celiagg.

zpincus avatar zpincus commented on June 19, 2024

Looks very clear now! Thanks :)

from celiagg.

Related Issues (20)

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.