[PATCH] Improved text label placement in KPlotWidget

Jason Harris kstars at 30doradus.org
Sat Aug 23 18:09:11 BST 2008


I took silence for consent and committed the patch (r851444).  Any
opinions on backporting this to 4.1?


On 8/19/08, Jason Harris <kstars at 30doradus.org> wrote:
> Hi,
>
> Here is an improved patch for label placement in KPlotWidget.  Now it
> will start over when finding a local minimum that is not below the
> maxCost threshold.  The code comments refer to "first-step paths".  By
> this I just mean that we have four path choices at the beginning: up,
> down, left, right.  It will try these in order of increasing cost.  If
> all four paths lead to local minima that are above maxCost, then it
> adopts the best of these minima (called bestBadCost in the code).
>
> I have verified that the code is only a bit slower than the previous
> patch (now 85-95 msec in the solar system tool, instead of 80-90).
>
> Note that I haven't implemented the "start at last label position"
> feature which should prevent the labels from jumping around so much.
> This change may require an API addition to KPlotPoint (to retrieve the
> last label position), whereas the current patch doesn't affect the API
> at all.  If we are planning KDE-4.1.x releases, I'd like to apply the
> current patch to the 4.1 branch as well as trunk.
>
> thanks for any feedback,
> Jason
>




More information about the kde-core-devel mailing list