pastthepixels / FreePaint

A vector graphics drawing app for Android.
GNU General Public License v3.0
81 stars 7 forks source link

[Feature] Having multiple types of brushes #25

Open P-Jelle opened 6 months ago

P-Jelle commented 6 months ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Having multiple types of brushes

Additional context For my study i need to work on an open source project. I found your project and would like to contribute.

pastthepixels commented 6 months ago

Thanks for deciding to contribute to FreePaint!

FreePaint could benefit from having a customisable brush tool, but the model I use for FreePaint's tools is that it has to have the same tools as Inkscape - in order to provide feature compatibility with desktop software users are familiar with and to have as much functionality as possible with as few tools as possible. As such, any new brush has to be an extension of the brush tool and not a new tool onto itself. That opens a can of worms though because FreePaint needs to have a separate configuration page for each tool -- however, again I would insist on this being the way to implement tools because I want to make FreePaint as close as possible to desktop vector graphics software.

Second, I need to mention how the tool works. Usually raster graphics software defines a paint tool as a bitmap that is applied to the screen whenever it detects a touch input on the canvas. To change the brush, all you need to do is change the bitmap. FreePaint is vector graphics software, which means it needs to draw a path -- each touch input is stored as a point on a line, and the resulting line is smoothed and treated as a path. If you want to have custom brush shapes, you need to define a closed path, and then every time a touch input is detected, paste the closed path onto the coordinates of the touch point and then apply a union operation on what was drawn already. Here, what you'll end up with is not an open path but a new closed path.

As you can see, this is a huge issue to undertake - but if you have any questions, let me know!

P-Jelle commented 6 months ago

I already started working on it. I made a spraypaint tool and created a pull request.