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

List:       koffice-devel
Subject:    Re: Flake Resize
From:       Fredy Yanardi <fyanardi () gmail ! com>
Date:       2007-02-24 18:28:46
Message-ID: 200702250228.47549.fyanardi () gmail ! com
[Download RAW message or body]

On Saturday 24 February 2007 14:34, Thorsten Zachmann wrote:
> I have tested your patch and found some problems:
>
> If you select more than one shape and resize them all they are resized by a
> different value. This can be easily seen when you use 2 ore more rects of
> the same size.
>
> Also the move of
>
>         keepAspect = keepAspect || shape->keepAspectRatio();
>
> to the shape loop will only keep the aspect of the shapes after the first
> shape has this property set. Before it is kept for all shapes when one
> shape has it set.
The selection of more that one shape still needs to be fixed but haven't tried 
to fixed it, maybe after I finish fixing all possible transformations on 
single shapes. And the keep aspect I must admit I just copied it to the inner 
loop and few hours later I just realized that stupid mistake :D

> I think the solution to the problem might be not so hard. I might be wrong
> here but I think the following code from the original code is to blame:
>
>         // construct the matrix tranformation we apply to the shape
>         QMatrix m = (QMatrix().rotate(shape->rotation())) * matrix  *
> (QMatrix().rotate(-shape->rotation()));
>
> Why is only the rotation taken into account but not the shearing/skaling?
> Maybe Casper can tell us more?
I also do not really understand what behind this, but for scaling / mirroring 
I recalculate the initial position (since initial position doesn't change if 
you only mirror the shape). For shearing I adjust the how much the shaped to 
be moved and also calculate the exact zoom since the zoom depends on shear 
factor.

Today I just fixed mirror + rotate + shear, if shearing applied before 
mirror / rotate, shearing applied after mirror / rotate is still broken, I 
suspect that's because of the code in KoShapeShearStrategy.cpp.

> Also one think I noticed is that most commands cannot be undone as. This is
> due to only having a KoShapeMoveCommand and a KoShapeSizeCommand but no
> commands for all the other properties that have changed.
>
> One more question. Do we want to rotate the bounding box with the shapes if
> there is more then one shape selected? I think most operations work quite
> well (not perfect) if you reselect the shapes after e.g. a rotation.
I'm a bit confused by your last question, can you explain further?

Have a nice weekend,

Fredy

> Have a nice day,
>
> Thorsten
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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