]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item.cc
release: 1.2.9
[lilypond.git] / lily / item.cc
index f74418df8db64f2e18cc3af1184d24ff4cb0e77d..e8ea0357df279be236b1f967808e36d71b5100c3 100644 (file)
@@ -5,11 +5,12 @@
 
   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+#include "dimension-cache.hh"
 
-#include "p-score.hh"
+#include "paper-score.hh"
 #include "debug.hh"
 #include "item.hh"
-#include "p-col.hh"
+#include "paper-column.hh"
 #include "spanner.hh"
 #include "lily-guile.hh"
 
@@ -37,7 +38,7 @@ Item::do_print() const
 Real 
 Item::hpos_f() const
 {
-  return absolute_coordinate (X_AXIS);
+  return relative_coordinate (0, X_AXIS);
 }
 
 Line_of_score *
@@ -53,9 +54,9 @@ Item::line_l() const
 void
 Item::copy_breakable_items()
 {
-  if (broken_to_drul_[LEFT] || broken_to_drul_[RIGHT] 
-      || ! breakable_b ())
-    return;
+  if (broken_to_drul_[LEFT] || broken_to_drul_[RIGHT]
+      || !breakable_b ())
+    return ;
 
   Drul_array<Item *> new_copies;
   Direction  i=LEFT;
@@ -90,7 +91,7 @@ Item::try_visibility_lambda ()
       int empty = gh_scm2bool (gh_cdr (result));
 
       if (empty)
-       set_empty (true);
+       set_empty (true, X_AXIS, Y_AXIS);
       if (trans)
        set_elt_property (transparent_scm_sym, SCM_BOOL_T);
     }
@@ -114,10 +115,12 @@ Item::do_breakable_col_processing()
 {
   if (breakable_b ())
     do_break ();
-
+  else
+    try_visibility_lambda ();
 }
-Item*
-Item::find_prebroken_piece (Line_of_score*l) const
+
+Score_element*
+Item::find_broken_piece (Line_of_score*l) const
 {
   if (line_l() == l) 
     return (Item*)(this);
@@ -130,7 +133,7 @@ Item::find_prebroken_piece (Line_of_score*l) const
 }
 
 Item*
-Item::find_prebroken_piece (Direction d) const
+Item::find_broken_piece (Direction d) const
 {
   if (!d)
     return (Item *) (this);    // ugh
@@ -184,11 +187,10 @@ Item::handle_prebroken_dependents ()
       Direction d = LEFT;
       do
        {
-         Item * broken_self = find_prebroken_piece (d);
-         Item * broken_parent = parent->find_prebroken_piece (d);
+         Item * broken_self = find_broken_piece (d);
+         Item * broken_parent = parent->find_broken_piece (d);
 
-         broken_self->dim_cache_[X_AXIS]->parent_l_ =
-           broken_parent->dim_cache_[X_AXIS];
+         broken_self->set_parent (broken_parent, X_AXIS);
 
          /*
            ugh. Should do this is after breaking?
@@ -198,14 +200,13 @@ Item::handle_prebroken_dependents ()
              Score_element * yparent =dynamic_cast<Score_element*>(parent_l (Y_AXIS));
              Item *yparenti = dynamic_cast<Item*> (yparent);
              Item *broken_yparent = yparenti ?
-               yparenti->find_prebroken_piece (d) : 0;
+               yparenti->find_broken_piece (d) : 0;
              
              if (!yparent)
                programming_error ("Vertical refpoint lost!");
              else if (yparenti)
                {
-                 broken_self->dim_cache_[Y_AXIS]->parent_l_ =
-                   broken_yparent->dim_cache_[Y_AXIS];
+                 broken_self->set_parent (broken_yparent, Y_AXIS);
                }
            }
        }
@@ -225,3 +226,4 @@ Item::break_status_dir () const
   else
     return CENTER;
 }
+