<div class="gmail_quote">On Fri, Mar 26, 2010 at 10:13 AM, Boudewijn Rempt <span dir="ltr">&lt;<a href="mailto:boud@valdyas.org">boud@valdyas.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Thursday 25 March 2010, Sven Langkamp wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; looking at <a href="https://bugs.kde.org/show_bug.cgi?id=228983" target="_blank">https://bugs.kde.org/show_bug.cgi?id=228983</a> I found out that we<br>
&gt; currently have a problem with defaultBounds there.<br>
&gt; I have added a new unit test see<br>
&gt; KisPixelSelectionTest::testInvertWithImage.<br>
&gt;<br>
&gt; The problem is that after inverting the pixel selection selectedExactRect<br>
&gt; is &quot;infinite&quot;. I would expect the it to have the size of the image.<br>
&gt; The selection has the rootlayer projection as parent and the projection has<br>
&gt; the default defaultBounds which is doesn&#39;t use the image bounds.<br>
&gt;<br>
&gt; Should we set the defaultBounds on the projection too?<br>
<br>
</div></div>It is worth a try, I think.<br>
<div class="im"><br></div></blockquote><div><br>We discussed this on IRC and the problem was bit different. If the selection has a empty paintdevice as parent it could get problem because the extent/exactBounds was intersected with the empty extent of the parent.<br>
<br>Here is my patch. Instead of using the parent device it uses KisDefaultBounds. The new behavior for selectedRect/selectedExactRect is like this: If the default pixel in MIN_SELECTED than the extent/exactBounds is used (intersected with defaultBounds to limit to bounds of the image) else defaultBounds is returned.<br>
DefaultBounds is set for global selection and KisMask.<br><br>The patch fixes the crash on inverting a global or local selection.<br></div></div>