Re: A couple of problems with KoShapePaste

Dmitry Kazakov <[email protected]>
Newsgroups gmane.comp.kde.devel.koffice
Message-ID <[email protected]>
On Thu, Nov 4, 2010 at 2:09 PM, Thomas Zander <[email protected]> wrote:

> On Thursday 4. November 2010 11.58.26 Dmitry Kazakov wrote:
> > > > It brings the first question, why KoShapePaste::process() first sets
> > > > the parent of the shape (uses way a) ) and then adds the same shape
> > > > into a controller (using way b) )? Why can't it just add this shape
> to
> > > > the controller in the end of the function?
> > >
> > > This way it ensures the parent is who it should be, instead of
> > > anticipating what the pure virtual controller would do.
> >
> > Ok then, but why does it set the parent in the beginning of the function
> > and add it to the controller in the beginning of the function? Isn't it
> > possible to write these two lines together one-under-the-other-one? I
> mean
> > not to split them with this big loop in the middle.
>
> I agree, this seems to have grown apart over time, it would make more sense
> to
> move that setParent down and make it into one modular part again.
>

Ok, i'll try to make a patch for this =)


 Yes, it would be slow as you need to iterate over all shapes for every
> paint.
>
> The most typical way stuff is painted is in a small square. For example if
> you
> have a text shape with a blinking cursor. The square thats repainted is
> 10x20
> pixels or so.
> Using the rtree its easy and cheap to find out which shapes this square
> intersects with and thus which need to be called to repaint.  Any other way
> takes too much time as you need to iterate over all shapes in a document.
> For a
> big document this can be thousands of shapes.
>

Hmm... I see..

-- 
Dmitry Kazakov

_______________________________________________
koffice-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/koffice-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.