<div class="gmail_quote">On Fri, Mar 26, 2010 at 10:13 AM, Boudewijn Rempt <span dir="ltr"><<a href="mailto:boud@valdyas.org">boud@valdyas.org</a>></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>
> Hi,<br>
><br>
> 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>
> currently have a problem with defaultBounds there.<br>
> I have added a new unit test see<br>
> KisPixelSelectionTest::testInvertWithImage.<br>
><br>
> The problem is that after inverting the pixel selection selectedExactRect<br>
> is "infinite". I would expect the it to have the size of the image.<br>
> The selection has the rootlayer projection as parent and the projection has<br>
> the default defaultBounds which is doesn't use the image bounds.<br>
><br>
> 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>