alist_chain));
Stencil elt = fm->find_by_name ("scripts.trill_element");
-
+ elt.align_to (Y_AXIS, CENTER);
Real elt_len = elt.extent (X_AXIS).length ();
if (elt_len <= 0.0)
{
}
while (len + elt_len < dz.length ());
- line.rotate (dz.arg (), Offset (0,0));
+ line.rotate (dz.arg (), Offset (LEFT, CENTER));
line.translate (from);
return line;
void
Stencil::rotate (Real a, Offset off)
{
- rotate_degrees (a *180/M_PI, off);
+ rotate_degrees (a * 180/M_PI, off);
}
/*
- Rotate this stencil around the point [x, y]
+ Rotate this stencil around the point RELATIVE_OFF.
+
+ RELATIVE_OFF is measured in terms of the extent of the stencil, so
+ -1 = LEFT/DOWN edge, 1 = RIGHT/UP edge.
*/
void
-Stencil::rotate_degrees (Real a, Offset off)
+Stencil::rotate_degrees (Real a, Offset relative_off)
{
const Real x_cen = extent (X_AXIS).center ();
const Real y_cen = extent (Y_AXIS).center ();
/*
* Calculate the center of rotation
*/
- const Real x = x_cen + off[X_AXIS] * x_cen;
- const Real y = y_cen + off[Y_AXIS] * y_cen;
+ const Real x = x_cen + relative_off[X_AXIS] * x_cen;
+ const Real y = y_cen + relative_off[Y_AXIS] * y_cen;
/*
* Build scheme expression (processed in stencil-interpret.cc)