From 7f2b2e13641c146f4b62631ed89638aba610ae07 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 21 Apr 2010 11:49:57 +0100 Subject: [PATCH] cogl-path: Document how a shape is filled This adds some documentation to cogl_path_fill() describing the fill rule Cogl uses. --- clutter/cogl/cogl/cogl-path.h | 28 +++++++++++++++++++++++----- doc/reference/cogl/Makefile.am | 6 +++++- doc/reference/cogl/fill-rule.png | Bin 0 -> 3121 bytes 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 doc/reference/cogl/fill-rule.png diff --git a/clutter/cogl/cogl/cogl-path.h b/clutter/cogl/cogl/cogl-path.h index 4037cc374..8e81cb397 100644 --- a/clutter/cogl/cogl/cogl-path.h +++ b/clutter/cogl/cogl/cogl-path.h @@ -54,9 +54,25 @@ G_BEGIN_DECLS /** * cogl_path_fill: * - * Fills the constructed shape using the current drawing color. The - * current path is then cleared. To use the path again, call - * cogl_path_fill_preserve() instead. + * Fills the interior of the constructed shape using the current + * drawing color. The current path is then cleared. To use the path + * again, call cogl_path_fill_preserve() instead. + * + * The interior of the shape is determined using the 'even-odd' + * rule. Any open sub-paths are treated as if there is an extra line + * joining the last point and first point. You can work out whether + * any point in the stage will be filled if you imagine drawing an + * infinitely long line in any direction from that point and then + * counting the number times it crosses a line in the path. If the + * number is odd it will be filled, otherwise it will not. + * + * See for a demonstration of the fill + * rule. + * + *
+ * Example of filling various paths + * + *
**/ void cogl_path_fill (void); @@ -64,8 +80,10 @@ cogl_path_fill (void); /** * cogl_path_fill_preserve: * - * Fills the constructed shape using the current drawing color and - * preserves the path to be used again. + * Fills the interior of the constructed shape using the current + * drawing color and preserves the path to be used again. See + * cogl_path_fill() for a description what is considered the interior + * of the shape. * * Since: 1.0 **/ diff --git a/doc/reference/cogl/Makefile.am b/doc/reference/cogl/Makefile.am index c6cbe11f4..c0d9b22fa 100644 --- a/doc/reference/cogl/Makefile.am +++ b/doc/reference/cogl/Makefile.am @@ -90,7 +90,8 @@ EXTRA_HFILES= # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES= +HTML_IMAGES = \ + fill-rule.png # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml @@ -117,3 +118,6 @@ include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in + +EXTRA_DIST += \ + fill-rule.png diff --git a/doc/reference/cogl/fill-rule.png b/doc/reference/cogl/fill-rule.png new file mode 100644 index 0000000000000000000000000000000000000000..1e4fbb0f2a2dc04953609dfb942f48db046e46c1 GIT binary patch literal 3121 zcmb7Gc|4Tc8-HiPkU=SBWEr`%a7}j*VGOcWqTHJrVPu&ZvX1OiV~I~mDUxN<$dbB7 zY6c;Dv@k<B)-w{bp(ui5|AX7016?3|7KF+7 z{)6924RwRCvIx%l7ZxdEs+W51pL)Ga>ZqSNtOtk<3rIl=zU!LnJ=qC;g%$K#*tud|YePErg3$5j8yC zGrwz&n`NK{4gx|=rw_cq;p{9sTk&#zN^R?587+7{-wtr5!qqd?ME zD(?zWlYuUX)qixAZg9ULYSiAC>Y;lQA#^wJc_r=lHwEr{pwj)2CJfj;IhP(2ST@ZW+c}uA*N*xm($z?(scfC=>~+5`;W9p zR%aLW2UCGSVTsejsnkuH78M3$4To%C!XrbhFgZ7M@*#BkiluF|b_pT3G2UTm^{JmY z{_oaPX3r~>5ClmWcy0gI%J1)q3)=$#teQLD1!3JsZ$xHiY_5-DP*fZo3q)b8zsb2( zyZN+#_$uAEP-+e?!tMQonAF#Y zOESX9L#X=e6C0lTB#hYtyGOOQCutR#T zhqc~SRqqJnzRg`adVjX=ik{$l?o4yclBud^ZQ2>3IJE!4y`Aj|>}Rhoq^Awnq-rwq zaP2l7iwFBmt~!4zT2@gBxz1{-d~c`Ae-oe#>IIiMMZ>ikXokGrz}`t6bMa&y!3}cn z+ZkHYh&U92+?Fcja|S^FNZyg~;C^Q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