Patch: don't save tiles that are equal to the default tile

Cyrille Berger cberger at cberger.net
Tue Mar 16 18:06:12 CET 2010


On Tuesday 16 March 2010, Dmitry Kazakov wrote:
> On Tue, Mar 16, 2010 at 6:42 PM, Cyrille Berger <cberger at cberger.net> wrote:
> > On Tuesday 16 March 2010, Dmitry Kazakov wrote:
> > > Selections and cutting should use KisDataManager::clear(), through
> > > KisPaintDevice::fill() [1]. This method uses tiles to fill the rect and
> > > substitutes default tile, if the fill-pixel is default.
> > 
> > Should really the data manager knows about selection ? Or maybe we could
> > call
> > a data manager function to tell it check that area for "default" tiles.
> 
> Of course it should know nothing! ;) At least not more than we agreed
> during filter api discussion.
> Selections even don't need the access to datamanager. The only thing they
> need:
> 
> KisPaintDevice::fill(color, rect)
> KisPaintDevice::setDefaultPixel(color)
> KisPaintDevice::defaultPixel()
> KisPaintDevice::region() [not implemented yet]
> 
> Changing the default pixel to e.g. QColor(255,255,255) would create an
> infinite selection. And selectedRect() will start to return image->bounds()
> instead of empty rect.
> 
> Changing the default pixel to QColor(0,0,0) will select nothing by default.
> 
> Calling fill() will just select/deselect a rect.
> 
> region() is what we were discussing on sprint.
> 
> Why do you think data manager should know anything?
I think you missed my point :)

Lets say I open an image, I then select an area (non necessarily rectangular), 
then I go to the edit menu and choose cut or clear, it will replace my 
selection by transparent pixels in function of selectedness on my image. And 
neither KisDataManager::fill/KisDataManager::clear apply in this case, since 
they take a rectangle as argument.

-- 
Cyrille Berger


More information about the kimageshop mailing list