From: Jan Nieuwenhuizen Date: Sun, 3 May 1998 23:33:15 +0000 (+0200) Subject: partial: 0.1.61.jcn X-Git-Tag: release/0.1.61~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7e6d1d18bac6d6d4667e614b759bf337190075fb;p=lilypond.git partial: 0.1.61.jcn --- diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc new file mode 100644 index 0000000000..193ef482b5 --- /dev/null +++ b/lily/encompass-info.cc @@ -0,0 +1,65 @@ +/* + encompass-info.cc -- implement Encompass_info + + source file of the GNU LilyPond music typesetter + + (c) 1998 Jan Nieuwenhuizen + +*/ + +#include "proto.hh" +#include "stem.hh" +#include "note-column.hh" +#include "paper-def.hh" +#include "encompass-info.hh" + +Encompass_info::Encompass_info () +{ + assert (0); +} + +Encompass_info::Encompass_info (Note_column const* note, Direction dir) +{ + Paper_def* paper = note->paper (); + Real interline = paper->interline_f (); + Real notewidth = paper->note_width (); + Real internote = interline / 2; + + Stem* stem = note->stem_l_; + /* + set o_.x () to middle of notehead or on eo_.x ()act o_.x () position of stem, + according to slur direction + */ + o_.x () = stem->hpos_f (); + + if (stem->dir_ != dir) + { + o_.x () += 0.5 * notewidth; + // ugh + if (dir == DOWN) + o_.x () -= 0.5 * notewidth; + else + o_.x () += 0.5 * notewidth; + } + else if (stem->dir_ == UP) + o_.x () += 1.0 * notewidth; + +// o_.x () -= left_o_.x (); + + o_.y () = stem->height ()[dir]; + + /* + leave a gap: slur mustn't touch head/stem + */ + if (stem->dir_ != dir) + o_.y () += 3.0 * internote * dir; + else + o_.y () += 2.0 * internote * dir; + + // ugh + if (dir == DOWN) + o_.y () += 1.5 * internote * dir; + +// o_.y () -= left_o_.y (); +} + diff --git a/lily/include/encompass-info.hh b/lily/include/encompass-info.hh new file mode 100644 index 0000000000..6180ba3677 --- /dev/null +++ b/lily/include/encompass-info.hh @@ -0,0 +1,25 @@ +/* + encompass-info.hh -- declare Encompass_info + + source file of the GNU LilyPond music typesetter + + (c) 1998 Jan Nieuwenhuizen + +*/ + +#ifndef ENCOMPASS_INFO_HH +#define ENCOMPASS_INFO_HH + +#include "lily-proto.hh" +#include "direction.hh" +#include "offset.hh" + +struct Encompass_info +{ + Encompass_info (); + Encompass_info (Note_column const*, Direction); + + Offset o_; +}; + +#endif // ENCOMPASS_INFO_HH