+2006-04-18 Erlend Aasland <erlenda@gmail.com>
+
+ * lily/include/stem-tremolo.hh:
+ * lily/stem-tremolo.cc: move rotated_box () to Lookup:: and update
+ callers.
+
+ * lily/lookup.cc: add rotated_box ()
+ * lily/include/lookup.hh:
+
2006-04-18 Heikki Junes <hjunes@cc.hut.fi>
* scripts/GNUmakefile: bugfix: run help2man only after scripts have
static Stencil dot (Offset p, Real radius);
static Stencil bracket (Axis a, Interval iv, Real thick, Real protude, Real blot);
static Stencil accordion (SCM arg, Real interline_f, Font_metric *fm);
+ static Stencil rotated_box (Real slope, Real width, Real thick, Real blot);
static Stencil round_filled_polygon (vector<Offset> const &points, Real blotdiameter);
static Stencil frame (Box b, Real thick, Real blot);
static Stencil slur (Bezier controls, Real cthick, Real thick);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (height, (SCM));
DECLARE_SCHEME_CALLBACK (calc_style, (SCM));
- static Stencil rotated_box (Real slope, Real width, Real thick, Real blot);
static Stencil raw_stencil (Grob *, Real, Direction stemdir);
static Real get_beam_translation (Grob *me);
};
return Stencil (box, at);
}
+Stencil
+Lookup::rotated_box (Real slope, Real width, Real thick, Real blot)
+{
+ vector<Offset> pts;
+ Offset rot (1, slope);
+
+ thick -= 2*blot;
+ width -= 2*blot;
+ rot /= sqrt (1 + slope*slope);
+ pts.push_back (Offset (0, -thick / 2) * rot);
+ pts.push_back (Offset (width, -thick / 2) * rot);
+ pts.push_back (Offset (width, thick / 2) * rot);
+ pts.push_back (Offset (0, thick / 2) * rot);
+ return Lookup::round_filled_polygon (pts, blot);
+}
+
Stencil
Lookup::horizontal_line (Interval w, Real th)
{
return beam ? Beam::get_beam_translation (beam) : 0.81;
}
-/* FIXME: move to Lookup? */
-Stencil
-Stem_tremolo::rotated_box (Real slope, Real width, Real thick, Real blot)
-{
- vector<Offset> pts;
- Offset rot (1, slope);
-
- thick -= 2*blot;
- width -= 2*blot;
- rot /= sqrt (1 + slope*slope);
- pts.push_back (Offset (0, -thick / 2) * rot);
- pts.push_back (Offset (width, -thick / 2) * rot);
- pts.push_back (Offset (width, thick / 2) * rot);
- pts.push_back (Offset (0, thick / 2) * rot);
- return Lookup::round_filled_polygon (pts, blot);
-}
-
Stencil
Stem_tremolo::raw_stencil (Grob *me, Real slope, Direction stemdir)
{
width *= ss;
thick *= ss;
- Stencil a = style == ly_symbol2scm ("rectangle") ?
- rotated_box (slope, width, thick, blot) :
- Lookup::beam (slope, width, thick, blot);
+ Stencil a;
+ if (style == ly_symbol2scm ("rectangle"))
+ a = Lookup::rotated_box (slope, width, thick, blot);
+ else
+ a = Lookup::beam (slope, width, thick, blot);
+
a.align_to (X_AXIS, CENTER);
a.align_to (Y_AXIS, CENTER);