From: Han-Wen Nienhuys Date: Tue, 31 Aug 2004 22:39:51 +0000 (+0000) Subject: (struct Simple_spacer): remove X-Git-Tag: release/2.3.14~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=286b81accdca4a86239425de564014a145109a6e;p=lilypond.git (struct Simple_spacer): remove expand_only option. --- diff --git a/THANKS b/THANKS index 61b823e18b..0064bc24b7 100644 --- a/THANKS +++ b/THANKS @@ -24,6 +24,7 @@ Peter Lutek BUG HUNTERS/SUGGESTIONS Bertalan Fodor +Ed Jackson Dave Phillips David Bobroff David Brandon diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index 3e7e6b45eb..05f9a96d3e 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -95,9 +95,9 @@ } me->warning (_f ("distance=%f", distance));//debug Real strength = 1.0; - Spaceable_grob::add_spring (lc, rc, distance, strength, false); + Spaceable_grob::add_spring (lc, rc, distance, strength); if (Item *rb = r->find_prebroken_piece (LEFT)) - Spaceable_grob::add_spring (lc, rb, distance, strength, false); + Spaceable_grob::add_spring (lc, rb, distance, strength); continue; } diff --git a/lily/include/paper-system.hh b/lily/include/paper-system.hh index 879ed05b00..63cffb3fb1 100644 --- a/lily/include/paper-system.hh +++ b/lily/include/paper-system.hh @@ -17,8 +17,8 @@ A formatted "system" (A block of titling also is a Paper_system) To save memory, we don't keep around the System grobs, but put the - formatted content of the grob is put into a Paper_system. Page-breaking handles - Paper_system objects. + formatted content of the grob is put into a + Paper_system. Page-breaking handles Paper_system objects. */ class Paper_system @@ -26,8 +26,8 @@ class Paper_system DECLARE_SMOBS (Paper_system, ); Stencil stencil_; bool is_title_; - public: + Interval staff_refpoints_; Real penalty_; int number_; diff --git a/lily/include/simple-spacer.hh b/lily/include/simple-spacer.hh index 48e8dd2e34..bfd8b38b65 100644 --- a/lily/include/simple-spacer.hh +++ b/lily/include/simple-spacer.hh @@ -19,7 +19,6 @@ struct Spring_description Real ideal_; Real hooke_; bool is_active_; - Real block_force_; Real length (Real force) const; @@ -38,18 +37,17 @@ struct Simple_spacer Real line_len_; Real default_space_; int active_count_; - bool compression_penalty_b_; Simple_spacer (); void solve (Column_x_positions *, bool); - void add_columns (Link_arrayconst &); + void add_columns (Link_array const &); void my_solve_linelen (); void my_solve_natural_len (); Real active_springs_stiffness () const; Real range_stiffness (int, int) const; void add_rod (int l, int r, Real dist); - Real range_ideal_len (int l, int r)const; + Real range_ideal_len (int l, int r) const; Real is_activelocking_force ()const; Real configuration_length ()const; void set_active_states (); diff --git a/lily/include/spring.hh b/lily/include/spring.hh index 0decf664f7..3224d77189 100644 --- a/lily/include/spring.hh +++ b/lily/include/spring.hh @@ -27,7 +27,8 @@ public: }; DECLARE_UNSMOB(Spring_smob, spring); -struct Spring{ +struct Spring +{ Drul_array item_l_drul_; Real distance_; bool expand_only_b_; diff --git a/lily/paper-system.cc b/lily/paper-system.cc index f51d2cbd7e..885b865cab 100644 --- a/lily/paper-system.cc +++ b/lily/paper-system.cc @@ -127,3 +127,14 @@ LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil", return ps->to_stencil ().smobbed_copy (); } + + +LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents", + 1, 0, 0, (SCM system), + "Return the top and bottom staff refpoint.") +{ + Paper_system *ps = unsmob_paper_system (system); + SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system"); + return ly_interval2scm (ps->staff_refpoints_); +} + diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index 8aab99bc4f..f8c1f94b64 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -274,12 +274,6 @@ Simple_spacer::add_columns (Link_array const &icols) active_count_ ++; } - - if (spring->expand_only_b_) - { - compression_penalty_b_ = true; - } - } for (int i=0; i < cols.size () - 1; i++) diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 5477f624ad..a25f2973db 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -47,7 +47,7 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d) } void -Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength, bool expand_only) +Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength) { // printf ("dist %lf, str %lf\n", d, strength); if (d <= 0.0 || strength <= 0.0) diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index fdc5bacad4..85b7c3dbaf 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -654,9 +654,7 @@ Spacing_spanner::musical_column_spacing (Grob *me, Item * lc, Item *rc, Real inc distance = compound_note_space; } - // Spaceable_grob::add_spring (lc, rc, distance, strength, expand_only); - - Spaceable_grob::add_spring (lc, rc, distance, strength, false); + Spaceable_grob::add_spring (lc, rc, distance, strength); } @@ -803,7 +801,7 @@ Spacing_spanner::breakable_column_spacing (Grob*me, Item* l, Item *r,Moment shor */ Real strength = 1 / (compound_space - compound_fixed); Real distance = compound_space; - Spaceable_grob::add_spring (l, r, distance, strength, false); + Spaceable_grob::add_spring (l, r, distance, strength); } diff --git a/lily/system.cc b/lily/system.cc index ff7d30c43f..6f57b2db61 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -335,13 +335,20 @@ System::get_line () Start with layer 3, since scm_cons prepends to list. */ SCM all = get_property ("all-elements"); - + Interval staff_refpoints; for (int i = LAYER_COUNT; i--;) for (SCM s = all; ly_c_pair_p (s); s = ly_cdr (s)) { Grob *g = unsmob_grob (ly_car (s)); Stencil *stil = g->get_stencil (); + if (i == 0 + && Axis_group_interface::has_interface (g) + && dynamic_cast (g)) + { + staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS)); + } + /* Skip empty stencils and grobs that are not in this layer. */ if (!stil || robust_scm2int (g->get_property ("layer"), 1) != i) @@ -361,6 +368,7 @@ System::get_line () st.translate (o + extra); *tail = scm_cons (st.expr (), SCM_EOL); tail = SCM_CDRLOC(*tail); + } @@ -374,7 +382,7 @@ System::get_line () exprs)); Paper_system *pl = new Paper_system (sys_stencil, false); - + pl->staff_refpoints_ = staff_refpoints; Item * break_point =this->get_bound(LEFT); pl->penalty_ = robust_scm2double (break_point->get_property ("page-penalty"), 0.0); diff --git a/scm/page-layout.scm b/scm/page-layout.scm index 8672062a3d..1b2f7db5f0 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -279,7 +279,7 @@ CURRENT-BEST is the best result sofar, or #f." (node-penalty (car best-paths)))) (page-height (page-height this-page-num last?)) (space-used (cumulative-height current-lines)) - (this-page-penalty (height-penalty page-height space-used)) + (this-page-penalty (height-penalty page-height space-used)) (user-penalty (ly:paper-system-break-penalty (car current-lines))) (total-penalty (combine-penalties user-penalty this-page-penalty prev-penalty))