[kde-edu]: KDE/kdeedu/libkdeedu/kdeeduplot
Benoît Jacob
jacob at math.jussieu.fr
Wed Oct 18 21:18:44 CEST 2006
Sounds good! I don't have any experience with kmplot, so I don't know how good
it is at drawing labels. Your algorithm seems to make sense, only you have
the experience to tell how well/fast it does the job. Really, if you think
it's good enough for kdeeduplot, then go ahead: I can't deny I'm short on
time and don't want to duplicae something that has already been done in KDE!
So just tell me what you decide. On the other hand, if you don't do it, then I
might be better off implementing my own algorithm rather than trying to
extract the relevant part of your code.
Benoit
Le mercredi 18 octobre 2006 20:53, David Saxton a écrit :
> KmPlot has some code for automatic positioning of labels (to avoid
> overwriting other labels or existing plots). If this is appropriate for
> your use, look in svn://trunk/KDE/kdeedu/kmplot/kmplot/view.[cpp/h], in
> particular "View::initDrawLabels" and "View::drawLabel".
>
> The algorithm is pretty crude, but fast enough - it just keeps track of
> where stuff has been drawn, and when View::drawLabel is called with a label
> and a position, it just shifts the position about until it finds somewhere
> close by with most of the label area unused. If the label could not be
> drawn over the requested position, then it draws a line from the label to
> the requested position.
>
> David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-edu/attachments/20061018/1e1b842b/attachment.pgp
More information about the kde-edu
mailing list