[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: koffice/libs/flake/tests
From:       Thorsten Zachmann <t.zachmann () zagge ! de>
Date:       2009-09-24 4:00:46
Message-ID: 200909240600.46687.t.zachmann () zagge ! de
[Download RAW message or body]


Hello,

On Wed September 23 2009, Thomas Zander wrote:
> On Wednesday 23. September 2009 22.48.21 Jan Hambrecht wrote:
> > add some unit tests which shows some deficiencies in the
> > KoShapeReorderCommand
> 
> ohh, new tests :)
> 
> Awesome!

When playing with a testapp from Thomas I was trying to figure out what th a 
shape did not go to the background even when its z-order was changed to be the 
lowest. After some time I found the reason for it:

int KoShape::zIndex() const
{
    Q_D(const KoShape);
    if (parent()) // we can't be under our parent...
        return qMax((int) d->zIndex, parent()->zIndex());
    return d->zIndex;
}

This code causes some problems as it might result in multiple shapes returning 
the same z-Index. This is problematic as then the shapes sometimes change 
theit order. To reproduce the problem open the attached file:

Start from the lower right one to the top one and use "Send to Back". The 
result is not really as expected and when the shapes are moved and do overlap 
you will notice that the order of the shapes randomly changes. I think the 
test case Jan added shows this problem. 

When looking at the KoShapeReorderCommand I also noticed that this can create 
the duplicate z-index which will lead to the above described problems.

See also bug https://bugs.kde.org/show_bug.cgi?id=185952

What is the purpose of the if in the zIndex() function. How could the problem 
be solved.

Thorsten

["order_bug.odg" (application/vnd.oasis.opendocument.graphics)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic