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

List:       koffice-devel
Subject:    Re: A couple of problems with KoShapePaste
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2010-11-04 11:15:20
Message-ID: AANLkTinD82+d17wzdgAfCjvggoOx+zg1K2YNK+xEB0Z6 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Thu, Nov 4, 2010 at 2:09 PM, Thomas Zander <zander@kde.org> 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

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">On Thu, Nov 4, 2010 at 2:09 PM, Thomas Zander <span \
dir="ltr">&lt;<a href="mailto:zander@kde.org">zander@kde.org</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div class="im">On \
Thursday 4. November 2010 11.58.26 Dmitry Kazakov wrote:<br> &gt; &gt; &gt; It brings \
the first question, why KoShapePaste::process() first sets<br> &gt; &gt; &gt; the \
parent of the shape (uses way a) ) and then adds the same shape<br> &gt; &gt; &gt; \
into a controller (using way b) )? Why can&#39;t it just add this shape to<br> &gt; \
&gt; &gt; the controller in the end of the function?<br> &gt; &gt;<br>
&gt; &gt; This way it ensures the parent is who it should be, instead of<br>
&gt; &gt; anticipating what the pure virtual controller would do.<br>
&gt;<br>
&gt; Ok then, but why does it set the parent in the beginning of the function<br>
&gt; and add it to the controller in the beginning of the function? Isn&#39;t it<br>
&gt; possible to write these two lines together one-under-the-other-one? I mean<br>
&gt; not to split them with this big loop in the middle.<br>
<br>
</div>I agree, this seems to have grown apart over time, it would make more sense \
to<br> move that setParent down and make it into one modular part \
again.<br></blockquote><div><br>Ok, i&#39;ll try to make a patch for this =)<br>  \
<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">

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



_______________________________________________
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