[cairo-commit] [cairo-www] src/tutorial.mdwn
Nis Martensen
nmartensen at freedesktop.org
Sun Jun 5 02:35:26 PDT 2011
src/tutorial.mdwn | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit ef504be5893b66549ddf982b82c87c766ff9e1f6
Author: Nis Martensen <nis.martensen at web.de>
Date: Sat Jun 4 17:38:33 2011 +0200
Tutorial: try to avoid confusion
The recent web commit "make it more intuitive" indicates that there are
people who try to insert the code snippets from the tutorial into the
sample from the FAQ, and do not get the results they expect. So let's
hint at the sample code behind the figure again.
Also refer to the transform section further below instead of mentioning
more path creation API details, as this might be even more confusing at
this stage of the tutorial.
diff --git a/src/tutorial.mdwn b/src/tutorial.mdwn
index 2dd1076..b5a9e10 100644
--- a/src/tutorial.mdwn
+++ b/src/tutorial.mdwn
@@ -158,10 +158,13 @@ transfer through the mask in a thin (or thick) line around the path,
according to the pen's
[line width](http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-width),
[dash style](http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-dash),
-and [line caps](http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-cap). Code stroke.c that uses this snippet is given by figure to the right. You may have to adjust cairo_rectangle's arguments to more intuitive or bigger values or make use of cairo_scale because it will draw an extremely small rectangle that is barely visible. Pasting this snippet to replace the text function calls in the sample FAQ's hello.c will yield no visible rectangle so you have to insert cairo_scale (cr, 120, 120);. When it doesn't work the first time, you may be tempted to insert a path creation code from API reference manual on Paths but don't like:<br><br>
- cairo_path_t *path;<br>
- cairo_path_data_t *data;<br>
- path = cairo_copy_path (cr);
+and [line caps](http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-set-line-cap).
+
+Note: To see the code snippet in action, use the stroke.c file linked
+from the figure to the right. Just pasting the snippet into the FAQ's
+hello.c might give unexpected results due to different scaling. Read on;
+scaling is explained in section <a href="#L1transforms">Working with
+Transforms</a> below.
cairo_set_line_width (cr, 0.1);
cairo_set_source_rgb (cr, 0, 0, 0);
More information about the cairo-commit
mailing list