From ac2106e6abd4442bca41a1e96ccca410667fa53b Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:56:17 +0000 Subject: [PATCH] lilypond-0.1.12 --- lily/include/lookup.hh | 9 ++++---- lily/tex-slur.cc | 49 ++++++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index ce55ce4657..c9af80091c 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -12,6 +12,7 @@ #include "symbol.hh" #include "fproto.hh" #include "scalar.hh" +#include "direction.hh" /// intuitive interface to symbol table struct Lookup { @@ -48,10 +49,10 @@ struct Lookup { Symbol bar (String, Real height) const; Symbol dots (int) const; - Symbol slur (int dy, Real &dx, int dir) const; - Symbol half_slur (int dy, Real &dx, int dir, int xpart) const; - Symbol half_slur_middlepart (Real &dx, int dir) const; - Symbol big_slur (int dy, Real &dx, int dir) const; + Symbol slur (int dy, Real &dx, Direction dir) const; + Symbol half_slur (int dy, Real &dx, Direction dir, int xpart) const; + Symbol half_slur_middlepart (Real &dx, Direction dir) const; + Symbol big_slur (int dy, Real &dx, Direction dir) const; Symbol text (String style, String text, int align = 1) const; Symbol script (String idx) const; Symbol hairpin (Real & width, bool decresc) const; diff --git a/lily/tex-slur.cc b/lily/tex-slur.cc index 3463d38494..30d06d3d32 100644 --- a/lily/tex-slur.cc +++ b/lily/tex-slur.cc @@ -15,20 +15,19 @@ #include "paper-def.hh" - -static -char direction_char (int y_sign) +static char +direction_char (Direction y_sign) { char c='#'; switch (y_sign) { - case -1: + case DOWN: c = 'd'; break; - case 0: + case CENTER: c = 'h'; break; - case 1: + case UP: c = 'u'; break; default: @@ -38,12 +37,14 @@ char direction_char (int y_sign) } Symbol -Lookup::half_slur_middlepart (Real &dx, int dir) const +Lookup::half_slur_middlepart (Real &dx, Direction dir) const { - if (dx >= 400 PT) {// todo - WARN<<"halfslur too large" <= 400 PT) + { + WARN<<"halfslur too large" <=0 && abs (dir) <= 1); - int y_sign = sign (dy); + + assert (abs (dir) <= 1); + if (dx < 0) + { + warning ("Negative slur/tie length: " + print_dimen (dx)); + dx = 4.0 PT; + } + Direction y_sign = (Direction) sign (dy); bool large = abs (dy) > 8; @@ -201,9 +209,14 @@ Lookup::slur (int dy , Real &dx, int dir) const } Symbol -Lookup::big_slur (int dy , Real &dx, int dir) const +Lookup::big_slur (int dy , Real &dx, Direction dir) const { - assert (dx >= 24 PT); + if (dx < 24 PT) + { + warning ("big_slur too small " + print_dimen (dx) + " (stretching)"); + dx = 24 PT; + } + Real slur_extra =abs (dy) /2.0 + 2; int l_dy = int (Real (dy)/2 + slur_extra*dir); int r_dy = dy - l_dy; -- 2.39.5