]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.7
authorfred <fred>
Sun, 24 Mar 2002 19:53:09 +0000 (19:53 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:53:09 +0000 (19:53 +0000)
lily/head-column.cc
lily/include/boxes.hh
lily/lookup.cc
lily/score-align-grav.cc

index d08519a8913e06b81a8880794556262b68630323..2d978bb60ebbaeb28f1314ec41faa8c007bf8e1f 100644 (file)
@@ -10,6 +10,7 @@
 #include "head-column.hh"
 #include "note-head.hh"
 #include "stem.hh"
+#include "script.hh"
 
 Head_column::Head_column()
 {
@@ -36,9 +37,18 @@ void
 Head_column::set(Stem*stem_l)
 {
     stem_l_ = stem_l;
-    add_dependency(stem_l);
+    Score_elem::add_dependency(stem_l);
+    for (int i=0; script_l_arr_.size(); i++)
+       script_l_arr_[i]->set_stem( stem_l );
 }
 
+void
+Head_column::add(Script *script_l)
+{
+    Script_column::add(script_l) ;
+    if  (stem_l_ )
+       script_l->set_stem( stem_l_ );
+}
 void
 Head_column::add(Note_head *n_l)
 {
index 22a2eec3a5f29ee524cd192aaee3e5277ac1f177..8161a84518ccd43b342a4ec3f236bd034c579ba7 100644 (file)
@@ -9,19 +9,28 @@
 #include "real.hh"
 #include "interval.hh"
 #include "offset.hh"
+#include "axes.hh"
 
-/// a square subset of Real^2
 struct Box {
-    Interval x, y;
-
+    Interval interval_a_[NO_AXES];
+    
+    Interval &x() {return interval_a_[X_AXIS]; }
+    Interval &y(){ return interval_a_[Y_AXIS]; }
+    Interval x()const{ return interval_a_[X_AXIS]; }
+    Interval y()const{return interval_a_[Y_AXIS]; }
+    Interval operator[](Axis a ) {
+       return interval_a_[a];
+    }
+    
     void translate(Offset o) {
-       x.translate(o.x);
-       y.translate(o.y);
+       x().translate(o.x());
+       y().translate(o.y());
     }
+
     /// smallest box enclosing #b#
     void unite(Box b) {
-       x.unite(b.x);
-       y.unite(b.y);
+       x().unite(b.x());
+       y().unite(b.y());
     }
     Box();
     Box(Interval ix, Interval iy);
index 6bc298e14798138be4ee70d69fe3eb43c24de6a1..e51a3e8b89498e103e2406abe7bc8f18f08f39fa 100644 (file)
@@ -109,7 +109,7 @@ Lookup::bar(String s, Real h) const
     a.push(print_dimen( h));
     Symbol ret=(*symtables_)("bars")->lookup(s);;
     ret.tex = substitute_args(ret.tex, a);
-    ret.dim.y = Interval( 0, h);
+    ret.dim.y() = Interval( 0, h);
     return ret;
 }
 
@@ -183,7 +183,7 @@ Lookup::hairpin(Real &wid, bool decresc) const
     Array<String> a;
     a.push(idx);
     ret.tex = substitute_args(ret.tex, a);
-    ret.dim.x = Interval(0,wid);
+    ret.dim.x() = Interval(0,wid);
     return ret;
 }
 
@@ -192,9 +192,8 @@ Lookup::linestaff(int lines, Real wid) const
 {
     Real internote_f = paper_l_ ->internote_f();
     Symbol s;
-    s.dim.x = Interval(0,wid);
     Real dy = (lines >0) ? (lines-1)*internote_f : 0;
-    s.dim.y = Interval(0,dy);
+    s.dim = Box(Interval(0,wid), Interval(0,dy));
 
     Array<String> a;
     a.push(lines);
@@ -211,8 +210,8 @@ Symbol
 Lookup::meter(Array<Scalar> a) const
 {
     Symbol s;
-    s.dim.x = Interval( 0 PT, 10 PT);
-    s.dim.y = Interval(0, 20 PT);      // todo
+    s.dim.x() = Interval( 0 PT, 10 PT);
+    s.dim.y() = Interval(0, 20 PT);    // todo
     String src = (*symtables_)("param")->lookup("meter").tex;
     s.tex = substitute_args(src,a);
     return s;    
@@ -229,8 +228,8 @@ Lookup::stem(Real y1,Real y2) const
     }
     Symbol s;
     
-    s.dim.x = Interval(0,0);
-    s.dim.y = Interval(y1,y2);
+    s.dim.x() = Interval(0,0);
+    s.dim.y() = Interval(y1,y2);
     
     Array<String> a;
     a.push(print_dimen(y1));
@@ -263,7 +262,7 @@ Lookup::vbrace(Real &y) const
        Array<String> a;
        a.push(idx);
        s.tex = substitute_args(s.tex,a);
-       s.dim.y = Interval(0,y);
+       s.dim.y() = Interval(0,y);
     }
     {
        Array<String> a;
index babf47bd321bb8d1f49a36ec2925ed4738b15444..9660c144eddddb751dfde22c3465504a7145dbee 100644 (file)
@@ -22,7 +22,7 @@ void
 Score_align_engraver::do_pre_move_processing()
 {
     if (align_p_) {
-       typeset_breakable_item( align_p_);
+       typeset_element( align_p_);
        align_p_ =0;
     }
 }
@@ -34,10 +34,13 @@ Score_align_engraver::acknowledge_element(Score_elem_info inf)
     
        if (!align_p_ ) {
            align_p_ = new Horizontal_group_item;
+           align_p_->breakable_b_ = true;
            announce_element(Score_elem_info(align_p_,0));
        }
-       
-       align_p_->add_element(inf.elem_l_);
+       Score_elem * unbound_elem = inf.elem_l_;
+       while ( unbound_elem->axis_group_l_a_[X_AXIS] )
+           unbound_elem = unbound_elem->axis_group_l_a_[X_AXIS];
+       align_p_->add_element(unbound_elem );
     }
     
 }