]> git.donarmstrong.com Git - lilypond.git/blob - src/textspanner.cc
86eac612cb08660b3c811d622d48385b0c15f47b
[lilypond.git] / src / textspanner.cc
1 #include "molecule.hh"
2 #include "boxes.hh"
3 #include "textspanner.hh"
4 #include "textdef.hh"
5 #include "debug.hh"
6
7 Text_spanner::Text_spanner(Directional_spanner*d)
8 {
9     support = d;
10     dependencies.add(d);
11 }
12
13 void
14 Text_spanner::do_post_processing()
15 {
16     switch(spec.align_i_) {
17     case 0:
18         tpos = support->center();
19         break;
20     default:
21         assert(false);
22         break;
23     }
24     
25     
26 }
27 Molecule*
28 Text_spanner::brew_molecule_p() const
29 {
30     Atom tsym (spec.create_atom(paper()));
31     tsym.translate(tpos);
32
33     Molecule*output = new Molecule;
34     output->add( tsym );
35     return output;
36 }
37
38 void
39 Text_spanner::print() const     // todo
40 {
41 #ifndef NDEBUG
42     mtor << "Text_spanner\n";
43 #endif
44 }
45
46 void
47 Text_spanner::do_pre_processing()
48 {
49     right = support->right;
50     left = support->left;
51     assert(left && right);
52 }
53
54 Interval
55 Text_spanner::height()const
56 {
57     return brew_molecule_p()->extent().y;
58 }
59
60 Spanner*
61 Text_spanner::do_break_at(PCol*c1, PCol*c2)const
62 {
63     return new Text_spanner(*this);    
64 }