]> git.donarmstrong.com Git - lilypond.git/blob - lily/staff-bracket.cc
release: 1.0.1
[lilypond.git] / lily / staff-bracket.cc
1 /*
2   span-score-bar.cc -- implement Span_score_bar
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "staff-bracket.hh"
10 #include "atom.hh"
11 #include "paper-def.hh"
12 #include "lookup.hh"
13 #include "main.hh"
14
15 Atom
16 Staff_bracket::get_bar_sym (Real dy) const
17 {
18   Atom a = lookup_l ()->vbracket (dy);
19
20   a.translate_axis (- 1.33 * a.extent ().x ().length (), X_AXIS);
21   return a;
22 }
23
24 Interval
25 Staff_bracket::do_width() const
26 {
27   return Interval (0,0);
28 }
29
30
31 void
32 Staff_bracket::do_post_processing ()
33 {
34   Span_score_bar::do_post_processing();
35   Interval i = Span_score_bar::do_height ();
36   // don't set bracket that spans less than one staff
37   Real staffheight_f = paper ()->staffheight_f ();
38   if (i.length () < 0.5 * staffheight_f)
39     {
40       transparent_b_ = true;
41       set_empty (true);
42     }
43 }
44
45 IMPLEMENT_IS_TYPE_B1(Staff_bracket, Span_score_bar);
46
47