<br><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 6:42 PM, Cyrille Berger <span dir="ltr">&lt;<a href="mailto:cberger@cberger.net">cberger@cberger.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Tuesday 16 March 2010, Dmitry Kazakov wrote:<br>
</div><div class="im">&gt; Selections and cutting should use KisDataManager::clear(), through<br>
&gt; KisPaintDevice::fill() [1]. This method uses tiles to fill the rect and<br>
&gt; substitutes default tile, if the fill-pixel is default.<br>
</div>Should really the data manager knows about selection ? Or maybe we could call<br>
a data manager function to tell it check that area for &quot;default&quot; tiles.<br></blockquote><div><br>Of course it should know nothing! ;) At least not more than we agreed during filter api discussion.<br>Selections even don&#39;t need the access to datamanager. The only thing they need:<br>
<br>KisPaintDevice::fill(color, rect)<br>KisPaintDevice::setDefaultPixel(color)<br>KisPaintDevice::defaultPixel()<br>KisPaintDevice::region() [not implemented yet]<br><br>Changing the default pixel to e.g. QColor(255,255,255) would create an infinite selection. And selectedRect() will start to return image-&gt;bounds() instead of empty rect.<br>
<br>Changing the default pixel to QColor(0,0,0) will select nothing by default.<br><br>Calling fill() will just select/deselect a rect.<br><br>region() is what we were discussing on sprint.<br><br>Why do you think data manager should know anything?<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
&gt; The eraser tool can use clear() too.<br>
</div>That is starting to be difficult, since it is done through the eraser composite<br>
op (that you can anyway select with any paintop...) But that would be<br>
marginal, main problem is cutting.<br>
</blockquote></div>yeah...<br><br>Well, maybe this deleting default tiles can be useful in some rare circumstances, but i think this feature should be done at the different level. It should be something like: KisTileHashTable::purge(). And we needn&#39;t call it every time we save an image, as it is too expensive.<br>
<br clear="all"><br>-- <br>Dmitry Kazakov<br>