Commit Graph

3 Commits

Author SHA1 Message Date
David Capello
92edd5f700 Add Brush::clone() functions to fix/simplify some Brush-related code
This refactor includes:

- In Lua now we can clone a custom brush with Brush(Image) and the new
  brush doesn't share the image with the original one (added a new test
  for this).

- Avoid creating extra images when it's not needed using
  Brush::cloneWithExistingImages() (we can inject existing images in
  the brush itself).

- Delete Brush-copy contructor & assign operator to use
  Brush::clone() functions instead (which are more explicit).

- Some code from 12d8135264 (#4023)
  reverted to avoid recreating brushes on left-click or in the brush
  preview, i.e. moving the mouse (#4013 refers only to right-click, so
  only on right-click we have to adjust the custom brush).
2024-05-03 11:35:36 -03:00
Gaspar Capello
12d8135264 Fix secondary color with custom brush paints the FgColor instead the BgColor (fix #4013)
Before this fix to change the main color of the image brush,
it was necessary to choose a new color from the palette.
The secondary color can now also be used.

Also added some tests for image brushes.
2024-04-29 17:20:56 -03:00
David Capello
c7cafca69a Merge remote-tracking branch 'tests/main' 2022-10-25 15:30:38 -03:00