source file of the GNU LilyPond music typesetter
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
Molecule
Lookup::line (Real th, Offset f, Offset t)
{
- SCM at = (scm_list_n (ly_symbol2scm ("draw-line"),
+ SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
gh_double2scm (th),
gh_double2scm (f[X_AXIS]),
gh_double2scm (f[Y_AXIS]),
gh_double2scm (t[X_AXIS]),
gh_double2scm (t[Y_AXIS]),
- SCM_UNDEFINED));
+ SCM_UNDEFINED);
Box box;
box.add_point (f);
return Molecule (box, at);
}
+Molecule
+Lookup::horizontal_line (Interval w, Real th)
+{
+ SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
+ gh_double2scm (w[LEFT]),
+ gh_double2scm (w[RIGHT]),
+ gh_double2scm (th),
+ SCM_UNDEFINED);
+
+
+ Box box ;
+ box[X_AXIS] = w;
+ box[Y_AXIS] = Interval (-th/2,th/2);
+
+ return Molecule (box, at);
+}
+
Molecule
Lookup::blank (Box b)
{
- return Molecule (b, SCM_EOL);
+ return Molecule (b, scm_makfrom0str (""));
}
Molecule
return Molecule (b,at);
}
+LY_DEFINE(ly_round_filled_box, "ly:round-filled-box",
+ 2, 0,0,
+ (SCM b, SCM blot),
+ "Make a box with rounded corners. B is a pair of number-pairs, and BLOT a number")
+{
+ SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG2, __FUNCTION__, "number") ;
+ SCM_ASSERT_TYPE(gh_pair_p (b), b, SCM_ARG4, __FUNCTION__, "pair") ;
+
+ SCM_ASSERT_TYPE(ly_number_pair_p (gh_car (b)), gh_car (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
+ SCM_ASSERT_TYPE(ly_number_pair_p (gh_cdr (b)), gh_cdr (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
+
+ Interval x (ly_scm2interval (gh_car (b)));
+ Interval y (ly_scm2interval (gh_cdr (b)));
+
+ return Lookup::roundfilledbox (Box (x,y),
+ gh_scm2double (blot)).smobbed_copy();
+
+}
+
+
/*
* Create Molecule that represents a filled polygon with round edges.
*
box.add_point (points[i]);
}
SCM polygon_scm = scm_list_n (ly_symbol2scm ("polygon"),
- ly_quote_scm (ly_quote_scm (shrinked_points_scm)),
+ ly_quote_scm (shrinked_points_scm),
gh_double2scm (blotdiameter),
SCM_UNDEFINED);