koffice/krita/image/recorder

Cyrille Berger cberger at cberger.net
Tue Jan 26 00:39:21 CET 2010


Hello,

I am a bit wondering why the node is set in the settings, especially since it 
leads some paintop to use the node that is on the settings, instead of the 
paint device define in KisPainter, which seems wrong to me. Also, keeping a 
pointer to the node in the settings lead to a danger that a node that is not 
used anymore keep staying in memory.

I investigate a bit, and the only reason I found for having the node in 
KisPaintOpSettings was caused by the filter brush, that need to know the color 
space to create filter configurations. But I could not find a good reason for 
KisPaintOpSettings::node(), so I am tempted to suggest removing that one, and 
keeping setNode as a virtual function (or rename it nodeChanged). Unless 
someone has a good reason ?

On Tuesday 26 January 2010, Cyrille Berger wrote:
> SVN commit 1080271 by berger:
> 
> Fix: replaying of spray
> 
> set the current node in the settings
> 
> 
> 
>  M  +2 -0      kis_recorded_paint_action.cpp
> 
> 
> --- trunk/koffice/krita/image/recorder/kis_recorded_paint_action.cpp
>  #1080270:1080271 @@ -183,6 +183,7 @@
> 
>          painter.setPaintColor(d->foregroundColor);
>          painter.setBackgroundColor(d->backgroundColor);
> +        d->paintOpPreset->settings()->setNode(node);
>          painter.setPaintOpPreset(d->paintOpPreset, info.image());
> 
>          playPaint(info, &painter);
> @@ -206,6 +207,7 @@
>              node->setDirty(painter.dirtyRegion());
>          }
>          if (info.undoAdapter()) info.undoAdapter()->addCommand(cmd);
> +        d->paintOpPreset->settings()->setNode(0);
>      }
>  }
> 


-- 
Cyrille Berger


More information about the kimageshop mailing list