+/*
+ tex-slur.cc -- implement Lookup::*slur
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
#include <math.h>
#include "misc.hh"
#include "lookup.hh"
#include "molecule.hh"
#include "dimen.hh"
#include "debug.hh"
+#include "paper-def.hh"
+
+
static
char direction_char(int y_sign)
if (dir < 0)
idx += 128;
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
- a.translate(Offset(dx/2,0));
- s.tex = a.TeXstring();
+ a.translate_x(dx/2);
+ s.tex = a.TeX_string();
return s;
}
hidx = -hidx;
hidx --;
int idx =-1;
-
idx = widx * 16 + hidx;
if (xpart < 0)
idx += 128;
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
assert(dx >=0 && abs(dir) <= 1);
int y_sign = sign(dy);
- bool large = dy > 16;
+ bool large = abs(dy) > 8;
if (y_sign) {
large |= dx>= 4*16 PT;
if (hidx <0)
hidx = -hidx;
hidx --;
- if (hidx > 16) {
+ if (hidx > 8) {
WARN<<"slur to steep: " << dy << " shrinking (ugh)\n";
}
idx += 54;
}
+ assert (idx < 256);
f+=String( "{" ) + String( idx ) + "}";
s.tex = f;
Atom a(s);
- a.translate(Offset(dx/2,0));
+ a.translate_x(dx/2);
s.dim = a.extent();
- s.tex = a.TeXstring();
+ s.tex = a.TeX_string();
return s;
}
Real slur_extra =abs(dy) /2.0 + 2;
int l_dy = int(Real (dy)/2 + slur_extra*dir);
int r_dy = dy - l_dy;
-
+
+ Real internote_f = paper_l_->internote_f();
Real left_wid = dx/4.0;
Real right_wid = left_wid;
Molecule mol;
mol.add(l);
Atom a(m);
- a.translate(Offset(0,slur_extra * internote()));
+ a.translate_y(slur_extra * internote_f);
mol.add_right(m);
mol.add_right(r);
- mol.translate(Offset(0, l_dy * internote()));
+ mol.translate_y( l_dy * internote_f);
Symbol s;
- s.tex = mol.TeXstring();
+ s.tex = mol.TeX_string();
s.dim = mol.extent();
return s;
}