Gtkmm DrawingArea tutorial query



Minor thing this...

In the DrawingArea section of the tutorial, on the page about arcs, at
 http://developer.gnome.org/gtkmm-tutorial/2.22/sec-cairo-drawing-arcs.html.en
the second paragraph shows how to draw an ellipse then says "this
contradicts the Cairo documentation". I don't think it does.

The apparent problem arises from a co-ordinate reference discrepancy.
When the Cairo documentation discusses ellipses, it uses x,y,w,h to
represent the bounding box of the desired ellipse. Thus the ellipse is
centred at x+w/2,y+h/2 and the translate operation uses that as the new
origin. In the Gtkmm tutorial, however, x,y refers to the centre of the
desired ellipse already, and the bounding box would be
x-width/2,y-height/2,width,height.

If you take this context difference into account, both examples do the
same thing. I would suggest, therefore, that the "This contradicts"
wording be changed to something like "This looks different to the
official Cairo documentation because we are defining our desired
position differently. They do the same thing in reality."

Cheers,
Rob


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