GNOME Bugzilla – Bug 336864
Cannot undo gimp-drawable-fill
Last modified: 2008-01-15 13:06:31 UTC
When I do a gimp-drawable-fill in the script-fu console, it seems to overwrite the last state of the layer and I cannot undo it. To replicate this problem: 1. Create a new image. 2. Draw something on it so you can recognize a change. 3. Open the script-fu console. 4. Do the following for three different cases. => (set! img N) => (set! drawable (car (gimp-image-get-active-drawable img))) a. => (gimp-selection-all img) => (gimp-edit-clear drawable) => (gimp-drawable-fill drawable BACKGROUND-FILL) Try to undo your actions. b. => (gimp-selection-all img) => (gimp-drawable-fill drawable BACKGROUND-FILL) Try to undo your actions. c. => (gimp-drawable-fill drawable BACKGROUND-FILL) Try to undo your action. All cases result in a blank layer filled with the background color. In case a there are two actions you can undo, the Clear and the Select All. In case b there is one action you can undo, the Select All. In case c there are no actions you can undo. In cases a and b, when you undo the last action, the layer still looks the same.
This is more of a statement of fact than a bug report. Undo is not a pdb enabled action. I cannot think of a situation where a script would need to or want to undo its actions. I am closing this bug as NOTABUG. If there is a situation in which undo is needed for a script, open a new bug report "Add undo to pdb" and present the situation it would be needed (or even helpful) in.
Hi, I am not requesting the addition of undo to pbd. I am saying that if I apply gimp-drawable-fill to a layer, I can't undo the effects by Edit->Undo or Crtl+Z. Thank you.
Yes. I understand that. It is expected behavior though. If you think that this behavior should be changed, you should file a new bug report in which you give an example of a use for this behavior.
Reopening as documentation bug. gimp-drawable-fill is intentionally not undoable. It's meant to initialize a *newly created* drawable without wasting undo memory. It must not be used on existing drawables, because that would leave the image in an un-undoable state. You are looking for gimp-edit-fill instead.
Does this apply to only this particular function? If thats the case, I'm not sure if the manual is the correct place for that. We provide one tutorial for the script-fu intermediates and one tutorial how people can install scripts. None of them (in my opinion) covers such a detail of writing scripts. If some of the actions aren't undoable, I could add a note, that people should be aware of that. Maybe a list of actions are helpful. I accept it as a documentation bug at first.
IMO it's api documentation and should appear in the pdb browser help text for this function. Which component would be most appropriate for this - libgimp, Script-Fu, ...? The API keyword would fit, at least.
This is not a bug about the user manual, it is simply a request for improving the API documentation for the PDB call. This is not strictly speaking part of libgimp, but we have always used the libgimp component for PDB API bugs.
2006-04-03 Sven Neumann <sven@gimp.org> * tools/pdbgen/pdb/drawable.pdb: improved API documentation for gimp-drawable-fill (bug #336864). * app/pdb/drawable_cmds.c * libgimp/gimpdrawable_pdb.c: regenerated.
...and I meant libgimp, not help :) sorry for the confusion...