#384 TopRuler scrolling


Subject: #384 TopRuler scrolling
From: Mike Nordell (tamlin@algonet.se)
Date: Sat Nov 11 2000 - 08:23:35 CST


When scrolling horizontally and revealing area left of the TopRuler it
doesn't paint characters (numbers) correctly.

The reason for this is quite simple. It only draws from the leftmost
revealed position, and since a character in this case _starts_ at a position
even more left, it doesn't even try to paint it. When the leftmost position
of the character gets into view to be painted, the cliprect (for the
revealed area) clips the right side of the painter char.

There are two solutions as I see it. One is "correct" and one "just works".

1. Start to paint characters one CharWidth to the left of the cliprect. This
would be "correct" by painting the right edge of the character in the
revealed area. It would also be overkill in this particular case I think.

2. Extend the cliprect width by the width of the number to be painted. Since
this would force us to calculate what number is on the leftmost position,
getting its width and so on, I propose the following change:

ap/xp/ap_TopRuler.cpp(265)

 else if (dx < 0)
 {
  x_dest += -dx;
  width += dx;
  rClip.left = x_src;
// rClip.width = -dx; // old
  rClip.width = -dx + 16; // ugly, but it works
 }

It's a hack that I'm not proud of, and it will also fail if the revealed
"string" is wider than 16 pixels.

What do you think, #384 closed?

/Mike



This archive was generated by hypermail 2b25 : Sat Nov 11 2000 - 08:22:03 CST