X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flookup.cc;h=5b0054084d6c6d5a2965dccc77a701916b152ae3;hb=472c212541034e95c30f5a1a6bc99d7f36f15b68;hp=1ee100caa92dd2ea6c9d2bbefed756c604f7e465;hpb=63c9cee8ce190aaae4a5db3d2e200d35a570838d;p=lilypond.git diff --git a/lily/lookup.cc b/lily/lookup.cc index 1ee100caa9..5b0054084d 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -19,6 +19,7 @@ #include "tex.hh" #include "scalar.hh" #include "paper-def.hh" +#include "string-convert.hh" #include "main.hh" Lookup::Lookup() @@ -145,6 +146,45 @@ Lookup::flag (int j, Direction d) const return (*symtables_p_)("flags")->lookup (c + String (j)); } +Atom +Lookup::slur (Array controls) const +{ + assert (postscript_global_b); + assert (controls.size () == 8); + + String ps = "\\embeddedps{\n"; + +#if 1 + for (int i = 1; i < 4; i++) + ps += String_convert::double_str (controls[i].x ()) + " " + + String_convert::double_str (controls[i].y ()) + " "; + + Real dx = controls[3].x (); + Real dy = controls[3].y (); + for (int i = 5; i < 8; i++) + ps += String_convert::double_str (controls[i].x () - dx) + " " + + String_convert::double_str (controls[i].y () - dy) + " "; +#else + // this would be nice + for (int i = 1; i < 4; i++) + ps += String_convert::double_str (controls[i].x ()) + " " + + String_convert::double_str (controls[i].y ()) + " "; + + for (int i = 5; i < 8; i++) + ps += String_convert::double_str (controls[i].x ()) + " " + + String_convert::double_str (controls[i].y ()) + " "; +#endif + + ps += " draw_slur}"; + + Atom s; + s.tex_ = ps; + + s.dim_[X_AXIS] = Interval (0, dx); + s.dim_[Y_AXIS] = Interval (0 ? dy); + return s; +} + Atom Lookup::streepje (int type) const { @@ -298,4 +338,3 @@ Lookup::vbracket (Real &y) const return bracket; } -