From: Han-Wen Nienhuys Date: Sun, 16 Oct 2005 14:28:39 +0000 (+0000) Subject: * lily/beam.cc: use length-fraction too. X-Git-Tag: release/2.7.13~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=84128b2439833721f06e544972736a43d3f20101;p=lilypond.git * lily/beam.cc: use length-fraction too. * lily/beam.cc: remove flag-width-function * lily/stem.cc (calc_length): multiply with length_fraction. Makes for easier grace tweaks. * lily/beam.cc: remove dir-function. * lily/note-head.cc (calc_stem_attachment): new function. (internal_print): use callback to get glyph-name. * lily/stem.cc (calc_stem_end_position): new function. (calc_length): new function. document details for stem. remove Stem::get_direction() * lily/stem.cc (height): idem. * lily/beam.cc (calc_direction): use pseudo-property for beam direction callback. (calc_positions): use callback * lily/stem.cc (calc_stem_end_position): use callback. (calc_positioning_done): idem. (calc_direction): idem. (calc_stem_end_position): idem (calc_stem_info): idem. --- diff --git a/input/les-nereides.ly b/input/les-nereides.ly index 12f2cb7ee2..66ca19752d 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -56,7 +56,7 @@ treble = \new Voice \relative c''{ cis''''4^\markup { \small \italic "m.g." }\arpeggio~ \grace { cis8 - \override Stem #'direction = #CENTER + \revert Stem #'direction a16[-5_( fis dis] #(set-octavation 0) diff --git a/lily/beam.cc b/lily/beam.cc index 839930d899..c0e2ff28e9 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1390,6 +1390,5 @@ ADD_INTERFACE (Beam, "positions " "quant-score " "shorten " - "space-function " "thickness " ); diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index 6fa52ea3bc..715179e41e 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -106,7 +106,7 @@ Fingering_engraver::make_script (Direction d, Music *r, int i) fingering->set_property ("script-priority", scm_from_int (priority)); - if (!is_direction (fingering->get_property ("direction"))) + if (!is_direction (fingering->get_property_data (ly_symbol2scm ("direction")))) { if (d) fingering->set_property ("direction", scm_from_int (d)); diff --git a/lily/note-head.cc b/lily/note-head.cc index eff41c8339..76ce69b706 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -152,7 +152,6 @@ ADD_INTERFACE (Note_head, "note-head-interface", /* properties */ "note-names " - "glyph-name-procedure " "accidental-grob " "stem-attachment " "style " diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 4c2fcaba64..e3954f494f 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -109,18 +109,22 @@ Span_bar::print (SCM smobbed_me) MAKE_SCHEME_CALLBACK (Span_bar, width_callback, 2); SCM -Span_bar::width_callback (SCM element_smob, SCM scm_axis) +Span_bar::width_callback (SCM smob, SCM scm_axis) { - Grob *se = unsmob_grob (element_smob); + Grob *me = unsmob_grob (smob); (void) scm_axis; assert ((Axis) scm_to_int (scm_axis) == X_AXIS); - String gl = ly_scm2string (se->get_property ("glyph-name")); + SCM gn = me->get_property ("glyph-name"); + if (!me->is_live ()) + return ly_interval2scm (Interval ()); + + String gl = ly_scm2string (gn); /* urg. */ - Stencil m = Bar_line::compound_barline (se, gl, 40 PT, false); + Stencil m = Bar_line::compound_barline (me, gl, 40 PT, false); return ly_interval2scm (m.extent (X_AXIS)); } diff --git a/lily/stem.cc b/lily/stem.cc index 296a5f00ca..cb41fa15fb 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -375,6 +375,13 @@ Stem::calc_positioning_done (SCM smob) Real thick = thickness (me); Grob *hed = support_head (me); + if (!dir) + { + programming_error ("Stem dir must be up or down."); + dir = UP; + set_grob_direction (me, dir); + } + Real w = hed->extent (hed, X_AXIS)[dir]; for (int i = 0; i < heads.size (); i++) heads[i]->translate_axis (w - heads[i]->extent (heads[i], X_AXIS)[dir],