[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-dancr-rbcatut-dwc

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2013年 4月 6日 (土) 05:22:08 JST


-------------------------
REMOTE_ADDR = 70.49.48.128
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dancr-rbcatut-dwc
-------------------------
@@ -421,6 +421,8 @@
 
 Cairo uses a connect-the-dots style system when creating paths. Start at 1, draw a line to 2, then 3, and so forth. When you start a path, or when you need to start a new sub-path, you want it to be like point 1: it has nothing connecting to it. For this, use cairo_move_to(). This sets the current reference point without making the path connect the previous point to it. There is also a relative coordinate variant, cairo_rel_move_to(), which sets the new reference a specified distance away from the current reference instead. After setting your first reference point, use the other path operations which both update the reference point and connect to it in some way.
 
+{{image_right("p11-path-moveto.png")}}
+
  cr.move_to(0.25, 0.25)
 
 
@@ -439,6 +441,12 @@
 
 Whether with absolute coordinates cairo_line_to() (extend the path from the reference to this point), or relative coordinates cairo_rel_line_to() (extend the path from the reference this far in this direction), the path connection will be a straight line. The new reference point will be at the other end of the line.
 
+
+{{image_right("p12-path-lineto.png")}}
+
+
  cr.rel_line_to(0.25, -0.125)
 
 
@@ -458,6 +464,15 @@
 
 Arcs are parts of the outside of a circle. Unlike straight lines, the point you directly specify is not on the path. Instead it is the center of the circle that makes up the addition to the path. Both a starting and ending point on the circle must be specified, and these points are connected either clockwise by cairo_arc() or counter-clockwise by cairo_arc_negative(). If the previous reference point is not on this new curve, a straight line is added from it to where the arc begins. The reference point is then updated to where the arc ends. There are only absolute versions.
 
+
+{{image_right("p13-path-arcto.png")}}
+
  cr.arc(0.5, 0.5, 0.25 * Math::sqrt(2), -0.25 * Math::PI, 0.25 * Math::PI)
 
 
@@ -475,6 +484,19 @@
 
 Curves in cairo are cubic B騷ier splines. They start at the current reference point and smoothly follow the direction of two other points (without going through them) to get to a third specified point. Like lines, there are both absolute (cairo_curve_to()) and relative (cairo_rel_curve_to()) versions. Note that the relative variant specifies all points relative to the previous reference point, rather than each relative to the preceding control point of the curve.
 
+
+{{image_right("p14-path-curveto.png")}}
+
+
  cr.rel_curve_to(-0.25, -0.125, -0.25, 0.125, -0.5, 0)
 
 
@@ -491,6 +504,23 @@
 
 
 Cairo can also close the path by drawing a straight line to the beginning of the current sub-path. This straight line can be useful for the last edge of a polygon, but is not directly useful for curve-based shapes. A closed path is fundamentally different from an open path: it's one continuous path and has no start or end. A closed path has no line caps for there is no place to put them.
+
+
+{{image_right("p15-path-close.png")}}
+
 
  cr.close_path
 




ruby-gnome2-cvs メーリングリストの案内
Back to archive index