From 7e6d1d18bac6d6d4667e614b759bf337190075fb Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 4 May 1998 01:33:15 +0200 Subject: [PATCH] partial: 0.1.61.jcn --- lily/encompass-info.cc | 65 ++++++++++++++++++++++++++++++++++ lily/include/encompass-info.hh | 25 +++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 lily/encompass-info.cc create mode 100644 lily/include/encompass-info.hh 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 -- 2.39.5