X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fsimple-spacer.cc;h=aef524da87579bb2ecb1e087409f0f2da04baa3f;hb=aae3ff48c2def641f2cda0d8f5950aeb63a2d84d;hp=10d49b83d9f44b73731238e7d3ee4cb05775dd65;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 10d49b83d9..aef524da87 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2011 Han-Wen Nienhuys + Copyright (C) 1999--2012 Han-Wen Nienhuys TODO: - add support for different stretch/shrink constants? @@ -160,6 +160,12 @@ Simple_spacer::configuration_length (Real force) const return l; } +void +Simple_spacer::set_force (Real force) +{ + force_ = force; +} + void Simple_spacer::solve (Real line_len, bool ragged) { @@ -364,9 +370,12 @@ get_column_description (vector const &cols, vsize col_index, bool line_s if (next_col) description.spring_ = Spaceable_grob::get_spring (col, next_col); - Grob *end_col = dynamic_cast (cols[col_index + 1])->find_prebroken_piece (LEFT); - if (end_col) - description.end_spring_ = Spaceable_grob::get_spring (col, end_col); + if (col_index + 1 < cols.size ()) + { + Grob *end_col = dynamic_cast (cols[col_index + 1])->find_prebroken_piece (LEFT); + if (end_col) + description.end_spring_ = Spaceable_grob::get_spring (col, end_col); + } for (SCM s = Spaceable_grob::get_minimum_distances (col); scm_is_pair (s); s = scm_cdr (s)) @@ -378,6 +387,9 @@ get_column_description (vector const &cols, vsize col_index, bool line_s if (cols[j] == other) description.rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s)))); else /* it must end at the LEFT prebroken_piece */ + /* see Spanner::set_spacing_rods for more comments on how + to deal with situations where we don't know if we're + ending yet on the left prebroken piece */ description.end_rods_.push_back (Rod_description (j, scm_to_double (scm_cdar (s)))); } } @@ -523,3 +535,21 @@ get_line_configuration (vector const &columns, return ret; } +#include "ly-smobs.icc" + +IMPLEMENT_SIMPLE_SMOBS (Simple_spacer); +IMPLEMENT_DEFAULT_EQUAL_P (Simple_spacer); + +SCM +Simple_spacer::mark_smob (SCM /* x */) +{ + return SCM_EOL; +} + +int +Simple_spacer::print_smob (SCM /* x */, SCM p, scm_print_state *) +{ + scm_puts ("#", p); + return 1; +} +