Re: filled rectangles differ ?
- From: Soeren Sandmann <sandmann daimi au dk>
- To: Havoc Pennington <hp redhat com>
- Cc: "Pawel S. Veselov" <Pawel Veselov Sun COM>, gtk-app-devel-list gnome org
- Subject: Re: filled rectangles differ ?
- Date: 30 Aug 2003 15:55:34 +0200
Havoc Pennington <hp redhat com> writes:
Yes, GDK just uses the X11 primitives. X draws filled primitives 1
pixel smaller. If you dig through the X docs you can probably find
some sort of rationale, I don't know offhand.
The rationale I invented for myself is like this: Think of the
coordinates as denoting the infinitely thin line _between_
pixels. When such a coordinate has to be converted to a pixel, it gets
converted to the pixel to the right/below of the thin line, but the
position it denotes is really _between_ two pixels.
If you think of this way, the filled rectangles make sense: they fill
the area between the two passed in thin lines.
Unfilled rectangles can be though of as four lines with width 1, so
each coordinate has to converted to a pixel.
It is often useful to think of C opinters and C++ iterators this way
too. The iterators in the TextView and the TreeView can also be
thought of like this.
Well, that works for me, YMMV.
Søren
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]