From a29cc8172070dd25a8da459c378a4fc6c0a3455d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 12 May 2005 09:30:49 +0000 Subject: [PATCH] * lily/slur-scoring.cc (move_away_from_staffline): robustness, don't access StaffSymbol if not there. * lily/instrument-name-engraver.cc (class Instrument_name_engraver): data member first_. Create InstrumentName on start. --- ChangeLog | 9 +++++++++ THANKS | 1 + lily/instrument-name-engraver.cc | 9 +++++++-- lily/slur-scoring.cc | 6 +++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb70211222..59d1fab6d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-05-12 Han-Wen Nienhuys + + * lily/slur-scoring.cc (move_away_from_staffline): robustness, + don't access StaffSymbol if not there. + + * lily/instrument-name-engraver.cc (class + Instrument_name_engraver): data member first_. Create + InstrumentName on start. + 2005-05-12 Graham Percival * Documentation/user/instrument-notation.itely: add guitar diff --git a/THANKS b/THANKS index f2bc6c3dc2..2e7e12ca56 100644 --- a/THANKS +++ b/THANKS @@ -45,6 +45,7 @@ Tineke de Munnik SPONSORS Bertalan Fodor +Chris Sawer Gunther Strube Hans Forbrich Jonathan Walther diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 34fcca0c22..e5ac0fe8fe 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -17,7 +17,7 @@ class Instrument_name_engraver : public Engraver { - + bool first_; public: TRANSLATOR_DECLARATIONS (Instrument_name_engraver); @@ -29,11 +29,13 @@ protected: virtual void acknowledge_grob (Grob_info); virtual void stop_translation_timestep (); virtual void process_music (); + }; Instrument_name_engraver::Instrument_name_engraver () { text_ = 0; + first_ = true; } void @@ -51,6 +53,8 @@ Instrument_name_engraver::stop_translation_timestep () get_property ("instrumentSupport")); text_ = 0; } + + first_ = false; } void @@ -119,7 +123,8 @@ Instrument_name_engraver::process_music () Also create text if barlines in other groups. This allows a name to be attached to lyrics or chords. */ - if (scm_is_string (get_property ("whichBar"))) + if (scm_is_string (get_property ("whichBar")) + || first_) create_text (); } diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 9b005386c4..22248890e8 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -598,8 +598,12 @@ Real Slur_score_state::move_away_from_staffline (Real y, Grob *on_staff) const { + Grob * staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff); + if (!staff_symbol) + return y; + Real pos - = (y - Staff_symbol_referencer::get_staff_symbol (on_staff)->relative_coordinate (common_[Y_AXIS], + = (y - staff_symbol->relative_coordinate (common_[Y_AXIS], Y_AXIS)) * 2.0 / staff_space_; -- 2.39.2