Git Product home page Git Product logo

Comments (9)

dsisnero avatar dsisnero commented on July 22, 2024

Here is a page that describes several implementations of rounded rectangles for cairo which is a vector library with primitives like pdf

http://cairographics.org/cookbook/roundedrectangles/

from prawn.

practicingruby avatar practicingruby commented on July 22, 2024

Definitely will accept a patch for this, but it needs to be on a fork with tests and examples

from prawn.

Bluejade avatar Bluejade commented on July 22, 2024

Definitely will accept a patch for this, but it needs to be on a fork with tests and examples

Question about this:
When I was making my star shape the other day, I wondered how one would write specs for it. The spec for, as an example, ellipse_at in the Prawn spec suite does test that the API hasn't changed, and that the pointer is back at the center of the ellipse, but it doesn't really test that an ellipse has been drawn, just the last point.

I guess one could create an example, render it, go into the resulting PDF and extract the generated points, and then create a regression test spec.

Do you have guidance on this, Greg?

Thank You,

Daniel

from prawn.

practicingruby avatar practicingruby commented on July 22, 2024

Yeah, good point. Just write some nice examples, and make sure that the API gets tested, and that if we're moving the pointer, it goes to the right place.

from prawn.

jonsgreen avatar jonsgreen commented on July 22, 2024

Not sure where jontebol got to but I went ahead as suggested by Greg (http://groups.google.com/group/prawn-ruby/browse_frm/thread/791dc2cb72a6ee0f) and took Salamandra's code and fixed it so that it will fill_and_stroke: http://github.com/jonsgreen/prawn/commit/059e035e55a3334d19345db0711a130aae39adeb. My spec is a bit contrived but at least it exercises the code.

from prawn.

jontebol avatar jontebol commented on July 22, 2024

I started, but then I had to focus on other things. I was still planning to do this though, possibly within a month or 2, but if you've fixed it already, that's great. :)

from prawn.

practicingruby avatar practicingruby commented on July 22, 2024

Sweet, we'll pull this in for 0.8, then.

from prawn.

jonsgreen avatar jonsgreen commented on July 22, 2024

I have made an improvement by implementing rounded_polygon making rounded_rectangle just a subset example (http://github.com/jonsgreen/prawn/commit/0b55e7da57c0f5da07fedf138ad197ca58072e6d) I did not add any specs for this method so far relying on the rounded_rectangle spec to exercise the polygon code. Let me know how I might improve the spec coverage for this feature if it is accepted. There is also a clever little pentagram in the rounded_polygon example.

from prawn.

practicingruby avatar practicingruby commented on July 22, 2024

Merged, thank you.

from prawn.

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.