X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcustos.cc;h=38dd09a6fc510131ce7079e5cee0c95380773064;hb=388121aed1734e9e536ede58bd3de98b68367842;hp=64f93c2a13f6ba4a3cffdb1929ecd47efb4cc1be;hpb=9193ac6225e2beafb8ea5da2610c70dd610e03be;p=lilypond.git diff --git a/lily/custos.cc b/lily/custos.cc index 64f93c2a13..38dd09a6fc 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -14,17 +14,16 @@ */ +#include +#include // rint -#include +#include "custos.hh" #include "direction.hh" #include "staff-symbol-referencer.hh" -#include "custos.hh" -#include "stencil.hh" #include "warn.hh" #include "note-head.hh" #include "item.hh" #include "font-interface.hh" -#include "math.h" // rint MAKE_SCHEME_CALLBACK (Custos,print,1); SCM @@ -34,7 +33,7 @@ Custos::print (SCM smob) SCM scm_style = me->get_property ("style"); String style; - if (gh_symbol_p (scm_style)) + if (scm_is_symbol (scm_style)) { style = ly_symbol2string (scm_style); } @@ -54,10 +53,10 @@ Custos::print (SCM smob) Direction neutral_direction = to_dir (me->get_property ("neutral-direction")); - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); int sz = Staff_symbol_referencer::line_count (me)-1; - String font_char = "custodes-" + style + "-"; + String font_char = "custodes." + style + "."; if (pos < neutral_pos) font_char += "u"; else if (pos > neutral_pos) @@ -85,20 +84,8 @@ Custos::print (SCM smob) me->warning (_f ("custos `%s' not found", font_char)); return SCM_EOL; } - else - { - // add ledger lines - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); - int interspaces = Staff_symbol_referencer::line_count (me)-1; - if (abs (pos) - interspaces > 1) - { - Stencil ledger_lines = - Note_head::brew_ledger_lines (me, pos, interspaces, - stencil.extent (X_AXIS), 0, true); - stencil.add_stencil (ledger_lines); - } - return stencil.smobbed_copy (); - } + + return stencil.smobbed_copy (); } ADD_INTERFACE (Custos, "custos-interface",