[Kstars-devel] branches/work/kdeedu_kstars_htm/kstars/kstars

James Bowlin bowlin at mindspring.com
Mon Aug 13 16:55:35 CEST 2007


On Mon August 13 2007 7:39 am, Jason Harris wrote:
> That is so weird.  Is it the screen (X,Y) coordinates changing, or
> just the sky coordinates that are supposed to correspond to X,Y?
>
> When am infobox is grabbed with the mouse, they are now all being
> drawn with the "grab color", instead of only the grabbed box.

I should have been more clear.  This has nothing to do with grabbing.
I added a new routine, reserveBoxes(), that is similar to drawBoxes().
In it, I don't draw anything, instead I use SkyLabeler to "mark" the
area under each info box so other labels won't overlap them.

This routine is called from near the top of SkyMapComposite::draw().
I noticed that it didn't work reliably, especially when skewing.
I put in printf statements in drawBoxes() and reserveBoxes() to print
out the (x,y) coordinates of one of the boxes.  For debugging, I 
also made SkyLabeler draw the outlines of the rectangle whenever
markRect() was called (hence the psky parameter).

What I found was that even though the coordinates in drawBoxes() stayed
constant, the coordinates during the reserveBoxes() call would sometimes
change.  This is what led me to saving the coordinates in the 
drawBoxes() routine for later use in reserveBoxes().

If you want to work on this, I suggest uncommenting the drawLine block
in SkyLabeler::markRect() (it is only called from InfoBoxes).  The info
boxes should be outlined in mostly solid red (unless there are things
in the sky overwriting the outlines).  Then stop using the saved 
coordinate kludge in reserveBoxes().  The red outlines will flicker.

Printf's will also work but they scroll by fast.

-- 
Peace, James

The personal life deeply lived always expands into truths beyond itself. 
-- Anais Nin


More information about the Kstars-devel mailing list