Re: Drawing lines in a gtk_layout



Jose Fernando Diago <jdiago escher puj edu co> writes: 
> You mean that I should offset the drawing coordinates like this:
> 
> gdk_draw_line(GTK_LAYOUT(widget)->bin_window, widget->style->black_gc, xini, yini, xfin + layout->xoffset, yfin + layout->yoffset);
> 

xoffset/yoffset are the position of the bin_window in the logical
coordinate space of the entire scrollable area (i.e. the area defined
by gtk_layout_set_size()).

So say you want to have a line at (100, 100) in the large coordinate
space (scrollable area). If xoffset, yoffset is currently (10, 10),
then the bin_window is at 10,10 in the scrollable area. So you have to
draw to (90,90) in the bin window. i.e. subtract the x/y offset from
the logical coordinates.

You need to offset both the start and end of the line (xini, yini as
well as xfin, yfin).

Havoc




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