From cbd8e652015a4c1ce53f86cefe412a101540ec6b Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:45:52 +0000 Subject: [PATCH] lilypond-1.1.19 --- lily/atom.cc | 2 +- lily/extender-spanner.cc | 34 ++++++++++++++++----------------- lily/include/dimension-cache.hh | 11 ++++++++++- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/lily/atom.cc b/lily/atom.cc index efe4bf30f1..e237f75b70 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -19,8 +19,8 @@ inline bool Atom::check_infinity_b ()const { bool ridiculous = false; -#ifndef NDEBUG +#ifndef NDEBUG /* infinity checks. */ for (int a = X_AXIS; a < NO_AXES; a++) { diff --git a/lily/extender-spanner.cc b/lily/extender-spanner.cc index 1ba1f66f79..2ca52271e6 100644 --- a/lily/extender-spanner.cc +++ b/lily/extender-spanner.cc @@ -20,7 +20,7 @@ Extender_spanner::Extender_spanner () : Directional_spanner () { - textitem_l_drul_[LEFT] = textitem_l_drul_[RIGHT] = 0; + item_l_drul_[LEFT] = item_l_drul_[RIGHT] = 0; dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0; dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0; } @@ -28,7 +28,7 @@ Extender_spanner::Extender_spanner () Extender_spanner::Extender_spanner (Extender_spanner const& c) : Directional_spanner (c) { - textitem_l_drul_ = c.textitem_l_drul_; + item_l_drul_ = c.item_l_drul_; dy_f_drul_ = c.dy_f_drul_; dx_f_drul_ = c.dx_f_drul_; } @@ -67,12 +67,12 @@ void Extender_spanner::do_add_processing () { Direction d = LEFT; - Drul_array new_textitem_drul = textitem_l_drul_; + Drul_array new_textitem_drul = item_l_drul_; do { - if (!textitem_l_drul_[d]) - new_textitem_drul[d] = textitem_l_drul_[(Direction)-d]; + if (!item_l_drul_[d]) + new_textitem_drul[d] = item_l_drul_[(Direction)-d]; } while (flip(&d) != LEFT); - textitem_l_drul_ = new_textitem_drul; + item_l_drul_ = new_textitem_drul; } Interval @@ -84,7 +84,7 @@ Extender_spanner::do_height () const void Extender_spanner::do_post_processing () { - assert (textitem_l_drul_[LEFT] || textitem_l_drul_[RIGHT]); + assert (item_l_drul_[LEFT] || item_l_drul_[RIGHT]); // UGH Real nw_f = paper ()->note_width () * 0.8; @@ -92,15 +92,13 @@ Extender_spanner::do_post_processing () Direction d = LEFT; do { - Text_item* t = textitem_l_drul_[d] ? textitem_l_drul_[d] : textitem_l_drul_[(Direction)-d]; + Item* t = item_l_drul_[d] ? item_l_drul_[d] : item_l_drul_[(Direction)-d]; dy_f_drul_[d] += t->extent (Y_AXIS).length () / 2; if (d == LEFT) dx_f_drul_[d] += t->extent (X_AXIS).length (); else dx_f_drul_[d] -= d * nw_f / 2; - -// dx_f_drul_[d] -= d * nw_f / 4; } while (flip(&d) != LEFT); } @@ -108,18 +106,18 @@ Extender_spanner::do_post_processing () void Extender_spanner::do_substitute_dependency (Score_element* o, Score_element* n) { - Text_item* new_l = n ? dynamic_cast (n) : 0; - if (dynamic_cast (o) == textitem_l_drul_[LEFT]) - textitem_l_drul_[LEFT] = new_l; - else if (dynamic_cast (o) == textitem_l_drul_[RIGHT]) - textitem_l_drul_[RIGHT] = new_l; + Item* new_l = n ? dynamic_cast (n) : 0; + if (dynamic_cast (o) == item_l_drul_[LEFT]) + item_l_drul_[LEFT] = new_l; + else if (dynamic_cast (o) == item_l_drul_[RIGHT]) + item_l_drul_[RIGHT] = new_l; } void -Extender_spanner::set_textitem (Direction d, Text_item* textitem_l) +Extender_spanner::set_textitem (Direction d, Item* textitem_l) { - assert (!textitem_l_drul_[d]); - textitem_l_drul_[d] = textitem_l; + assert (!item_l_drul_[d]); + item_l_drul_[d] = textitem_l; set_bounds (d, textitem_l); add_dependency (textitem_l); diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index 9962cc2a7a..e15bc9b5b1 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -9,13 +9,16 @@ #ifndef DIMENSION_CACHE_HH #define DIMENSION_CACHE_HH + #include "interval.hh" #include "real.hh" #include "lily-proto.hh" #include "parray.hh" - +/** + Adminstration of offset dimension info. + */ class Dimension_cache { bool valid_b_; @@ -24,12 +27,18 @@ class Dimension_cache */ bool empty_b_; Interval dim_; + /** + The offset wrt. to the center of #parent_l_# + */ Real offset_; Graphical_element *elt_l_; friend class Graphical_element; void init (); public: + /** The #offset_# is defined with regard to this graphical_element/ + dimension_cache. */ + Dimension_cache * parent_l_; Link_array dependencies_l_arr_; -- 2.39.5