Revision 832684

Go back to digest for 20th July 2008

Bug Fixes in Educational

Jason Harris committed changes in /trunk/KDE/kdeedu/kstars/kstars/skymap.cpp:

Fixing the bug that was causing runaway CPU usage when drawn lines moved off-screen at high zoom. Akarsh submitted a patch which fixed the symptom, but had some side effects. This patch reverts his change and corrects a very simple bug that was causing the problem.

We have a function SkyMap::onScreenLine( QPointF &p1, QPointF &p2 ) that returns the o-screen segment of a line, given endpoints p1 and p2. The modified on-screen endpoints are returned through the same reference values. In the case that no segment of the line connecting p1 and p2 passes through the SkyMap widget, null values of -10000000 are returned.

At some point, IIRC, James created an alternative onscreenLine2() function which does essentially the same thing, except it returns a bool instead of void, and the return value is used to indicate whether an onscreen line segment was found or not. There are no null values in this version of the function.

However, in one of the places where onscreenLine2() should have returned false (indicating the line was totally off-screen with no onscreen segment), it actually returned true. This was the cause of the runaway CPU usage.

James, can you confirm this patch, and then I will backport it to the 4.1 branch.

I don't remember why James created a second version of this function rather than modifying onscreenLine().

File Changes

Modified 1 files
  • /trunk/KDE/kdeedu/kstars/kstars/skymap.cpp
1 files changed in total