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 ();
25 Real notewidth = paper->note_width ();
26 Real internote = interline / 2;
28 Stem* stem = note->stem_l_;
30 set o_.x () to middle of notehead or on eo_.x ()act o_.x () position of stem,
31 according to slur direction
33 o_.x () = stem->hpos_f ();
35 if (stem->dir_ != dir)
37 o_.x () += 0.5 * notewidth;
40 o_.x () -= 0.5 * notewidth;
42 o_.x () += 0.5 * notewidth;
44 else if (stem->dir_ == UP)
45 o_.x () += 1.0 * notewidth;
47 // o_.x () -= left_o_.x ();
49 o_.y () = stem->height ()[dir];
52 leave a gap: slur mustn't touch head/stem
54 if (stem->dir_ != dir)
55 o_.y () += 3.0 * internote * dir;
57 o_.y () += 2.0 * internote * dir;
61 o_.y () += 1.5 * internote * dir;
63 // o_.y () -= left_o_.y ();