Skip to content

make the "splatter" brush continue to draw without mouse movement#1817

Merged
cameronwhite merged 4 commits into
PintaProject:masterfrom
spaghetti22:continuous-spraying
Nov 22, 2025
Merged

make the "splatter" brush continue to draw without mouse movement#1817
cameronwhite merged 4 commits into
PintaProject:masterfrom
spaghetti22:continuous-spraying

Conversation

@spaghetti22

Copy link
Copy Markdown
Contributor

Pinta until now behaved differently from other painting software in that the "splatter" brush required mouse movement in order to continue to draw. This makes sense for the other brushes, but not this one, because you might want a denser "spray" in one position than in others.

This PR makes Pinta behave the way MS Paint or KolourPaint do.

…ontinue to draw when mouse is kept in one position
@cameronwhite

Copy link
Copy Markdown
Member

Thanks for looking at this!

I'd prefer to keep the BasePaintBrush API as simple as possible (e.g. just a flag to indicate that a brush type wants continuous mouse events, or perhaps a control for the time interval)
Could the paint brush tool instead handle most of this? I think it mainly just needs to keep calling OnMouseMove with the same mouse event, and that could also reduce how much state is being managed for these callbacks

For the timer, using GLib.Functions.TimeoutAdd() as in #1829 may also be simpler to use

@spaghetti22

Copy link
Copy Markdown
Contributor Author

Hi, thanks for the feedback. I reorganized the code according to your suggestions; I hope I understood correctly what you meant.

@cameronwhite cameronwhite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is more along the lines of what I had in mind, but I left a few comments about ideas to simplify things further

Comment thread Pinta.Core/Classes/BasePaintBrush.cs Outdated
Comment thread Pinta.Tools/Brushes/SplatterBrush.cs Outdated
Comment thread Pinta.Tools/Tools/PaintBrushTool.cs Outdated
Comment thread Pinta.Tools/Tools/PaintBrushTool.cs Outdated
Comment thread Pinta.Tools/Tools/PaintBrushTool.cs Outdated

@cameronwhite cameronwhite left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I just have one last fix to suggest, noted in the comments, but otherwise this looks good to merge 👍

The format check on the CI builds is also failing - I think you should be able to run dotnet format to fix that, but if that's not easy for you to run in your environment I can run it myself before merging

Comment thread Pinta.Tools/Tools/PaintBrushTool.cs Outdated
Comment thread Pinta.Tools/Tools/PaintBrushTool.cs Outdated
@spaghetti22

Copy link
Copy Markdown
Contributor Author

The format check on the CI builds is also failing - I think you should be able to run dotnet format to fix that, but if that's not easy for you to run in your environment I can run it myself before merging

I can run, and did now run, dotnet format in my environment, but I am not sure that that did anything? Do I have to call it in any specific way?

@cameronwhite

Copy link
Copy Markdown
Member

The format check on the CI builds is also failing - I think you should be able to run dotnet format to fix that, but if that's not easy for you to run in your environment I can run it myself before merging

I can run, and did now run, dotnet format in my environment, but I am not sure that that did anything? Do I have to call it in any specific way?

The formatting check seems good now, so I guess your change also removed whatever the formatting error was 👍

Otherwise, dotnet format would do something and you'd see some changes in the git diff

@cameronwhite cameronwhite merged commit 248f01e into PintaProject:master Nov 22, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants