<font face="courier new,monospace">Hi all!<br><br>I'm revising our merging strategy at the moment. We have big problems<br>with it. I want it to take into account need rects of adjustment<br>layers.<br><br>At the moment i have problems with KisFilter::changedRect(rc)<br>
rect. Could someone describe me what it is? Is there any usecase for<br>that?<br><br>Actually, i understand that this is a rect that adjustment layer<br>changed after applying on @rc rect. But(!) how should update strategy<br>
treat this rect? There are two possibilities:<br><br>1) Update strategy should update this _expanded_ rect on all higher<br>layers<br><br>2) Update strategy should NOT pay any attention to this expanded rect<br>and all higher layers should update requested rect only.<br>
<br><br>Let's see it in example. Assume that our adjustment layer's change<br>rect is two pixels wider than requested rect and we have changed 2x2<br>rect on the lowest paint layer.<br><br>/**<br> * GL - group layer<br>
* AL - adj. layer<br> * PL - paint layer<br> */<br><br>GL Updated rect(1st case) Updated rect(2nd case)<br>|--PL 4x4 2x2<br>|<br>|--PL 4x4 2x2<br>
|<br>|--AL 4x4 4x4<br>|<br>+--PL 2x2 2x2<br><br><br>I think that the first case is more obvious, but it depends on the<br>meaning of changedRect() and it's usecases. Those are the things i<br>
can't understand.<br><br><br><br>Btw, why do i bother about this?<br><br><br>In my refactor of merging i'm going to collect all the needed rects<br>for all the layers in a top-down way. But if we pay attention to<br>
change rects and they don't depend on need rects this task will have<br>no trivial solution. Of course it will have one, but it'll be too<br>complex - it'll use "Least common multiple" stuff. Let's take a look<br>
at the case when this applies:<br><br><br>GL<br>|--PL<br>|<br>|--AL#2 cr:+3 nr:+5<br>|<br>|--AL#1 cr:+2 nr:+4<br>|<br>+--PL<br><br><br>Imagine AL#1 needs 2 additional pixels for need rect and 4px for<br>change rect<br>
but AL#2 3px for needRect and 5px for changeRect<br><br>I don't know how to merge layers in such a case.<br><br><br>There can be a solution for this if we define changeRect() to be an<br>inverse function for needRect(). So to say, needRect is +2, changeRect<br>
is -2. Generally, it means that we return to an old<br>overlapMarginNeeded() function.<br><br>What do you think?<br><br><br>PS:<br>A short summary of questions:<br>1) What is changedRect actually? And what are the usecases?<br>
2) How to merge that case with two adj. layers?<br>3) If there is no way how to merge it, should we revert to a<br> deprecated function?</font><br><br>-- <br>Dmitry Kazakov<br><br>