Skip to content

Slash brush#1974

Merged
cameronwhite merged 9 commits intoPintaProject:masterfrom
spaghetti22:slash-brush
Mar 5, 2026
Merged

Slash brush#1974
cameronwhite merged 9 commits intoPintaProject:masterfrom
spaghetti22:slash-brush

Conversation

@spaghetti22
Copy link
Contributor

Add a new "slash" brush with configurable angle, mimicking similar functionality in other painting programs such as XPaint, KolourPaint, old versions of MS Paint.

This is the first paint brush with a custom cursor so that the user can preview the angle and width of the slash, so this PR also implements a framework for individual paint brushes to have different cursors.

Copy link
Member

@cameronwhite cameronwhite left a comment

Choose a reason for hiding this comment

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

The brush is very nice to use 👍

… not big enough to hold rotated rectangle at large brush widths
Copy link
Member

@cameronwhite cameronwhite left a comment

Choose a reason for hiding this comment

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

I've added the Matrix3x2D changes that you can try out here, and just had a couple minor suggestions after re-reading the code with fresh eyes :)
Looks good to merge after this!

@cameronwhite
Copy link
Member

Thanks!

@cameronwhite cameronwhite merged commit 3648078 into PintaProject:master Mar 5, 2026
7 checks passed
@pedropaulosuzuki
Copy link
Contributor

The brush is indeed very nice to use! The only thing bothering me a bit is that the angle is not exactly the angle used for the brush. If we type 0deg, we still get some rotation. Same for 90deg. 45deg also looks a bit like 60deg or something.

Screencast.from.04-03-2026.23.48.02.webm

I understand the rotation adds to the style, but as we have an angle parameter, it's a bit weird that the angle doesn't match.

@spaghetti22
Copy link
Contributor Author

@pedropaulosuzuki Hi, thanks for the feedback; this isn't how it behaves for me. Does it behave that way for anyone else reading this? I may have to investigate why this happens for you; will try to find time to upload a screencast of what it looks like for me later today.

@spaghetti22
Copy link
Contributor Author

@pedropaulosuzuki Attached is a video of what it looks like on my (Debian testing, KDE Plasma, Wayland) machine where I developed it. I do not know why it is not working correctly for you; is there anything about your environment that I may need to know about?

Bildschirmaufnahme_20260305_195207.webm

@cameronwhite
Copy link
Member

I wonder if it's something to do with antialiasing, e.g. if the coordinates are at fractional values? Doing just a single-click makes it easier to see, but I think I see some extra rotation happening in your video too at the start of the stroke

One other thing I noticed while testing this out is that it seems like we lost the behaviour of the brush cursor changing size as you zoom in and out.

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.

3 participants