X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstencil.cc;h=3b92b558007aa71ba77383e83cb709ddc1ce049f;hb=d060f0152577ccb01bfa3d4c50a3f91d676573ca;hp=12bbf4ea128f0f573a41ae1e9b7d1f6cabd5fbe4;hpb=2819ba86363def7f615b7fbbf03aecef761296c6;p=lilypond.git diff --git a/lily/stencil.cc b/lily/stencil.cc index 12bbf4ea12..3b92b55800 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -76,14 +76,17 @@ Stencil::extent_box () const 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 (); @@ -91,8 +94,8 @@ Stencil::rotate_degrees (Real a, Offset off) /* * 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) @@ -195,7 +198,7 @@ Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding) Real his_extent; if (i.is_empty ()) { - programming_error ("Stencil::moved_to_edge: adding empty stencil."); + programming_error ("Stencil::add_at_edge: adding empty stencil."); his_extent = 0.0; } else