On Sat, May 13, 2017 at 05:00:43PM -0700, Dan Hitt wrote:
> So it appears that when you draw in a drawing area, using commands
> like (cairo_)move_to and (cairo_)line_to, the path is rendered
> relative to the top left of the area.
> 
> More explicitly, if you try to figure out how far you can draw, the x
> and y values from get_allocation(...) are not relevant, only the width
> and height.
> 
> Or in other words, the location at the top left of the drawing area
> has coordinates (0, 0) and at the bottom right has coordinates (width,
> height), rather than (x, y) and (x+width, y+height), at least as far
> as primitives like move_to and line_to are concerned.
> 
> This sure seems to be true on my system (debian stretch) using gtk3,
> but if i'm wrong, please correct me.

Yes, you are correct, things do work this way.

> Also, is this documented anywhere, or am i the only person clueless
> enough to try to get to the top left by going to the x,y returned by
> get_allocation, instead of to (0,0)?

This is documented in the draw signal docs [1].

Cheers,
Tadej


[1] https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-draw

-- 
Tadej Borovšak
tadeb...@gmail.com
tadej.borov...@gmail.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to