root/trunk/cairo/cairooo_snippets/snippets/set_line_join.d

Revision 119, 0.7 kB (checked in by DRK, 6 years ago)

* Added bindings for the Glitz and Xlib backends.
* Checked in cairooo: an OO layer on top of the cairo binding.
* Added snippets directory for cairooo
* Added basic tutorial on how to use cairooo
* Added a simple demo program.
* Added scripts for building import libraries.
* Fixed several bugs.
* Drank WAAY too much coffee.

Line 
1 module snippets.set_line_join;
2
3 private
4 {
5     import std.math;
6     import cairooo.all;
7     import snippets.common;
8 }
9
10 void snippet_set_line_join(Context cr, int width, int height)
11 {
12     void drawShape(double y)
13     {
14         cr.moveTo(0.3, y);
15         cr.relLineTo(0.2, -0.2);
16         cr.relLineTo(0.2, 0.2);
17     }
18
19     cr.lineWidth = 0.16;
20     drawShape(0.33);
21     cr.lineJoin = LineJoin.Miter;
22     cr.stroke();
23
24     drawShape(0.63);
25     cr.lineJoin = LineJoin.Bevel;
26     cr.stroke();
27
28     drawShape(0.93);
29     cr.lineJoin = LineJoin.Round;
30     cr.stroke();
31 }
32
33 static this()
34 {
35     snippets_hash["set_line_join"] = &snippet_set_line_join;
36 }
Note: See TracBrowser for help on using the browser.