Re: AA canvas w/ point grid


Smaller bug - you have to multiply x with 3
Bigger bug:
Canvas buffer has a kind of speedup for items not drawing anything into it. If first
created, it will be tagged as being background - which means, that buffer contents are
garbage, and first rendering item have to initialize it to backrounf color. If no item
removes that flag, canvas knows that nobody has drawn into it, and draws empty
rectangle instead of compying buffer.

I have used:
  if (buf->is_bg) {
    gnome_canvas_clear_buffer (buf);
    buf->is_bg = FALSE;
    buf->is_buf = TRUE;
in item implementations and that seems to work.


On 05 Feb 2001 12:05:44 +0100, Arjan J. Molenaar wrote:
> Hi,
> I'm currently working on a canvas (spin off from dia-newcanvas in gnome CVS actually) and am about to write the grid-item. However, I have great difficulty in drawing the grid properly. I think it's the easiest way (and probably the fastest) to modify the pixels in the GnomeCanvasBuf::buf directly. This however does not seem to work ;-(. I just do something like this:
>       buf->buf[y * buf->rowstride + x] = 0xFF; /* red */
>       buf->buf[y * buf->rowstride + x + 1] = 0xFF; /* green */
>       buf->buf[y * buf->rowstride + x + 2] = 0xFF; /* blue */
> I was expecting to see at least some white points on the canvas, but nothing seems to happen (except for a lot of my own debug messages).
> Is there something terribly wrong with this approach?
> Thanks in advance,
> Arjan
> _______________________________________________
> gnome-list mailing list
> gnome-list gnome org

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