Refactoring the polyline in pencil2d

So I’ve managed to get myself deep into the rabbit hole now.    https://github.com/pencil2d/pencil/issues/423

The way things are structured in pencil2d is that a polyline would be drawn in bitmap mode and  a bezier would be drawn in vector mode.  In my mind these are two very distinct ways of doing things and it makes no sense to me that they should be combined in the same class.
So….  I created a branch called polylineRefactor and  basically copied bezier.cpp into a separate class called \graphics\vector\polyline.cpp and commented out anything that looked like it had something to do with a bezier as well as anything else that keeps the program from building and running. https://github.com/JonasThomas/pencil/commit/ab9c2ad4e0588097e590c9518e5d493de9c1e89d

I left bezier.cpp intact for the most part for now and tried disconnecting it from pencil.  I think at some point it will need refactoring as well and at some point there should be a bezier icon on the pencil2d sight.
Anyway… At this point, the polyline tool is totally unusable.   If I do a mousedown I get a line starting at the start of the screen and the line drawing to the current  mouse position.   This is both vector and bitmap.
So… I’m thinking next steps.

Get the start of the line to appear at mouse down event.
Get the end of the line and new line to start and the second mouse down event.
Don’t have much time this weekend, but if I could get this done it would be a good start.Fun fun fun…. 😉

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *