]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.19
authorfred <fred>
Tue, 26 Mar 2002 21:45:52 +0000 (21:45 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:45:52 +0000 (21:45 +0000)
lily/atom.cc
lily/extender-spanner.cc
lily/include/dimension-cache.hh

index efe4bf30f137244cff9f06caf3c07d1355325d46..e237f75b7095d594cf775c3867f873fbf1425406 100644 (file)
@@ -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++)
     {
index 1ba1f66f792596f03129efeb975313dc9f860232..2ca52271e633efea1ff78a124b507be638c08042 100644 (file)
@@ -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<Text_item *> new_textitem_drul = textitem_l_drul_;
+  Drul_array<Item *> 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<Text_item *> (n) : 0;
-  if (dynamic_cast <Item *> (o) == textitem_l_drul_[LEFT])
-    textitem_l_drul_[LEFT] = new_l;
-  else if (dynamic_cast <Item *> (o) == textitem_l_drul_[RIGHT])
-    textitem_l_drul_[RIGHT] = new_l;
+  Item* new_l = n ? dynamic_cast<Item *> (n) : 0;
+  if (dynamic_cast <Item *> (o) == item_l_drul_[LEFT])
+    item_l_drul_[LEFT] = new_l;
+  else if (dynamic_cast <Item *> (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);
index 9962cc2a7a19ee5ca946044ffe285a39c91870d7..e15bc9b5b14c98a8865037e8704dba2cee296458 100644 (file)
@@ -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<Dimension_cache> dependencies_l_arr_;