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

List:       koffice-devel
Subject:    Re: Review Request: Kword drawing order fix
From:       "Thomas Zander" <zander () kde ! org>
Date:       2010-06-17 18:50:52
Message-ID: 20100617185052.15088.15103 () localhost
[Download RAW message or body]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4173/#review6168
-----------------------------------------------------------


> First it is not possible to draw something behind text without splitting
> background drawing and text drawing into two different shapes. So the
> amount of component changed would not be smaller.

This is something that can be done inside the text shape making the changes be \
completely invisible to kword and kpresenter so only one component has to be changed \
and all apps benefit.

> If I understand it right your suggestion was to combine two odf properties
> ("draw:z-index", "style:run-through") into one artificial zIndex.
> 
> To do this I have to:
> Wait until shapes are anchored into TextShape.
> Check the zIndex of all shapes anchored into ShapeContainer and somehow
> change the zIndex of every shape to have the right drawing order. Check if
> anchored shape was not moved into another ShapeContainer and if yes the
> zIndex for all shapes anchored into this ShapeContainer has to be
> recalculated.

You are right that that indeed does sound rather complicated.
I'm thinking there must be a simpler way. What about if you define (in KoText.h) the \
z index of the text layer (say, 10000) and all anchored shapes either have a zindex \
in front or below based on their run through style. How would that work then? Sounds \
like it would be simpler, no?

> To have proper saving it is necessary to have in memory the real zIndex,
> runThrough property, and artificial zIndex. When saving is needed it is
> necessary to somehow recalculate artificial zIndex into real zIndex and
> runThrough property.

The zIndex does non need to be preserved exactly, only the intention of it should be \
preserved between loading and saving. But even if you do want to keep it exactly the \
same that is easy to do by just adding/subtracting the hard coded z index of the text \
layer. But, again, I think that is not needed and the way its saved right now is Ok.

> In my opinion it is far more maintainable to have three ifs in
> KoShape::compareShapeZIndex than the logic with artificial zIndex.
> 
> If I understand your suggestion wrong please correct me.

I think some more complexity did creep into the project that was not needed. Sorry \
for the confusion, it would be good to keep communicating early and often and avoid \
bad surprises in the future :) So I see that this is your main reason for choosing to \
modify lots of stuff in KWord and also KoShape instead of just the text shape. The \
approach I outlined does look much more maintainable and easier to unit test and I'm \
sorry that you did all the work in a different direction without coming back to talk \
about the problems you had.

Would you be able to look into doing the layers in the text shape?

And I think I pointed out before that this really really needs unit tests.

- Thomas


On 2010-06-07 12:31:47, Matus Hanzes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/4173/
> -----------------------------------------------------------
> 
> (Updated 2010-06-07 12:31:47)
> 
> 
> Review request for KOffice.
> 
> 
> Summary
> -------
> 
> KWOdfLoader
> Added support for loading of frame properties for objects anchored in header or \
> footer, but I am not sure it is the right way to do it. 
> KOshape
> Added support for something like layers, so that shape placed in lower layer are \
> drawn earlyer than shape in higher layer. 
> KWFrame
> Have added support for placing shapes in layers.
> 
> RunThrough-Backgrond is placed in layer -1.
> RunThrough-Foreground is placed in layer 1.
> All others runAround properties are placed in layer 0.
> 
> 
> Diffs
> -----
> 
> trunk/koffice/kword/part/CMakeLists.txt 1135394 
> trunk/koffice/kword/part/KWOdfLoader.cpp 1135394 
> trunk/koffice/kword/part/KWOdfSharedLoadingData.cpp 1135394 
> trunk/koffice/kword/part/KWPageBackground.h PRE-CREATION 
> trunk/koffice/kword/part/KWPageBackground.cpp PRE-CREATION 
> trunk/koffice/kword/part/KWord.h 1135394 
> trunk/koffice/kword/part/KWord.cpp 1135394 
> trunk/koffice/kword/part/frames/KWFrame.h 1135394 
> trunk/koffice/kword/part/frames/KWFrame.cpp 1135394 
> trunk/koffice/kword/part/frames/KWFrameLayout.h 1135394 
> trunk/koffice/kword/part/frames/KWFrameLayout.cpp 1135394 
> trunk/koffice/kword/part/frames/KWTextFrameSet.cpp 1135394 
> trunk/koffice/libs/flake/KoShape.h 1135394 
> trunk/koffice/libs/flake/KoShape.cpp 1135394 
> trunk/koffice/libs/flake/KoShape_p.h 1135394 
> 
> Diff: http://reviewboard.kde.org/r/4173/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matus
> 
> 

_______________________________________________
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