]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/local-key-item.cc
release: 1.5.19
[lilypond.git] / lily / local-key-item.cc
index 1ffc2c696cca0a6d7d975b351bb981b1c210c412..52e7a65f775b03f063d2b9eab60c4a94ee80c07b 100644 (file)
@@ -171,8 +171,20 @@ Local_key_item::brew_molecule (SCM smob)
          oct_b = true; 
        }
       
+
       lastoct = p.octave_i () ;
 
+      bool cautionary = (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F);
+      SCM font_rel_siz = me->get_grob_property("font-relative-size");
+      SCM caut_siz = me->get_grob_property("cautionary-size");
+      int frs = (gh_exact_p(font_rel_siz) ? gh_scm2int(font_rel_siz) : 0);
+      int cs = (gh_exact_p(caut_siz) ? gh_scm2int(caut_siz) : 0);
+
+
+      // Ugh. This will only work if only called once on each grob. --rz
+      if (cautionary && caut_siz!=0)
+       me->set_grob_property ("font-relative-size",gh_int2scm(frs+cs));
+
       SCM c0 =  me->get_grob_property ("c0-position");
       Real dy = (gh_number_p (c0) ? gh_scm2int (c0) : 0 + p.notename_i_)
        * note_distance;
@@ -189,8 +201,8 @@ Local_key_item::brew_molecule (SCM smob)
          acc.add_at_edge (X_AXIS, LEFT, Molecule (prefix), 0);
        }
 
-      if (scm_memq (ly_symbol2scm ("cautionary"), opts) != SCM_BOOL_F)
-       acc = parenthesize (me, acc);
+      if (cautionary && to_boolean(me->get_grob_property("paren-cautionaries")))
+        acc = parenthesize (me, acc);
 
       acc.translate_axis (dy, Y_AXIS);
       octave_mol.add_at_edge (X_AXIS, RIGHT, acc, 0);