After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794854 - Brush color is not added to color history in smudge tool
Brush color is not added to color history in smudge tool
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
2.10.0-RC1
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2018-03-31 07:11 UTC by shark0r
Modified: 2018-04-05 00:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a patch try to fix this (2.05 KB, text/plain)
2018-03-31 07:11 UTC, shark0r
Details

Description shark0r 2018-03-31 07:11:44 UTC
Created attachment 370366 [details]
a patch try to fix this

Relative article:
https://bugzilla.gnome.org/show_bug.cgi?id=785001
Previously posted there, but I was suggested to open a new bug.

I added painting ability to smudge tool but forgot one thing available in other paint tools : When painting the foreground color was not added to color history.

My study:

In other tools there are two ways to achieve this. Airbrush and Pencil inherit GimpPaintbrush class, and Ink and MyPaint Brush check the conditions and call gimp_palettes_add_color_history() by themself.

In smudge tool I chose the latter way because GimpPaintbrush and GimpSmudge seemed to share few common features.
For example, airbrush uses _gimp_paintbrush_motion() for painting, but smudge tool can't use this function because smudge tool has different algorithm from this function.
Comment 1 Jehan 2018-04-01 04:26:56 UTC
Quick look: that looks good. I'll make a quick test tomorrow to double check and most likely push.
Comment 2 Michael Natterer 2018-04-01 11:01:25 UTC
commit e55c94eff0a9b2715b052b61fdc95bb071882c8c
Author: shark0r <b91502038@ntu.edu.tw>
Date:   Fri Mar 30 01:53:12 2018 +0800

    Bug 794854 - Brush color is not added to color history in smudge tool
    
    Add the color in gimp_smudge_paint(INIT) like GimpPaintbrush does.
    
    Achieve this by calling gimp_palettes_add_color_history() directly,
    not by inheriting GimpPaintbrush because GimpPaintbrush and GimpSmudge seem to share few common features.

 app/paint/gimpsmudge.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
Comment 3 John Ralls 2018-04-05 00:12:03 UTC
*** Bug 794962 has been marked as a duplicate of this bug. ***