2 encompass-info.cc -- implement Encompass_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
12 #include "note-column.hh"
13 #include "paper-def.hh"
14 #include "encompass-info.hh"
16 Encompass_info::Encompass_info ()
21 Encompass_info::Encompass_info (Note_column const* note, Direction dir)
23 Paper_def* paper = note->paper ();
24 Real interline = paper->interline_f ();
26 Real notewidth = paper->note_width () * 0.8;
27 Real internote = interline / 2;
29 Stem* stem = note->stem_l_;
31 set o_.x () to middle of notehead or on the exact position of stem,
32 according to slur direction
34 o_.x () = stem->hpos_f ();
45 if (stem->dir_ != dir)
46 o_.x () -= 0.5 * notewidth * stem->dir_;
48 o_.y () = stem->extent (Y_AXIS)[dir];
50 leave a gap: slur mustn't touch head/stem
52 o_.y () += 2.5 * internote * dir;
54 if (stem->dir_ != dir)
55 o_.y () += 1.0 * internote * dir;