Re: Graphical glitch in a scrolled window




On Jul 27, 2008, at 9:02 AM, Tian wrote:

I did a small test program that I attached. Run it, and scroll down. You will see that things goes weird somewhere. I am not sure if it's always on the same line that it occurs. And also resizing the window can do some changes in the way it is displayed.

I added this:

$scroll->get_vadjustment ()->signal_connect (value_changed => sub {
        my ($self) = @_;
        print "v: ".join(' ', $self->value, $self->page_size,
                              $self->value + $self->page_size) ."\n";
});


and then ran the program and scrolled to where the glitch starts. With the window set such that the bottom of the last image that doesn't have the glitch is at the bottom of the scrolled window (as close as i could get it with the mouse, at least), i get this:

v: 32326.1739130435 380 32706.1739130435

and with that same spot just past the top of the window, i get this:

v: 32701.3291925466 380 33081.3291925466

Now, knowing that the upper bound of a signed 16 bit integer is 0x7FFF = 32767, and also that there are signed 16-bit integers used in the size parameters for X window objects, a diagnosis leaps to mind...


It looks like the vbox is calculating the spacing for its children correctly, but the tiling logic for the GtkStyle suffers rounding error that messes up the tiling.


I'd say, port this to C and file a bug against gtk+.



--
Leia/Lois:  Aren't you a little fat for a stormtrooper?
Luke/Chris: Well, stay here and rot, you stuck-up bitch.
  -- Family Guy, "Blue Harvest" (A "Star Wars" parody)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]