X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fottava-bracket.cc;h=63a9d3ebca37adaa2b60dd4bce024875b2301202;hb=c8ad65d84d9c5f939c787fe956ac1346f9294bd4;hp=7def9bf96cf9887297de6432997f3a7e7acab80c;hpb=f4abbfff5f0d985a457e15586dbcc3ae473b0dee;p=lilypond.git diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 7def9bf96c..63a9d3ebca 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2004--2014 Han-Wen Nienhuys + Copyright (C) 2004--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,6 @@ struct Ottava_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_GROB_INTERFACE (); }; /* @@ -49,7 +48,7 @@ MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1); SCM Ottava_bracket::print (SCM smob) { - Spanner *me = dynamic_cast (Grob::unsmob (smob)); + Spanner *me = unsmob (smob); Interval span_points; Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS); @@ -61,7 +60,7 @@ Ottava_bracket::print (SCM smob) Item *b = me->get_bound (d); broken[d] = (b->break_status_dir () != CENTER); - if (Note_column::has_interface (b)) + if (has_interface (b)) { extract_grob_set (b, "note-heads", heads); common = common_refpoint_of_array (heads, common, X_AXIS); @@ -79,7 +78,7 @@ Ottava_bracket::print (SCM smob) SCM markup = me->get_property ("text"); Stencil text; if (Text_interface::is_markup (markup)) - text = *Stencil::unsmob (Text_interface::interpret_markup (layout->self_scm (), + text = *unsmob (Text_interface::interpret_markup (layout->self_scm (), properties, markup)); Drul_array shorten = robust_scm2interval (me->get_property ("shorten-pair"), @@ -94,7 +93,7 @@ Ottava_bracket::print (SCM smob) Item *b = me->get_bound (d); Interval ext; - if (Note_column::has_interface (b)) + if (has_interface (b)) { extract_grob_set (b, "note-heads", heads); for (vsize i = 0; i < heads.size (); i++) @@ -119,6 +118,8 @@ Ottava_bracket::print (SCM smob) else span_points[d] = ext[d]; + + span_points[d] -= d * shorten[d]; } /* @@ -155,21 +156,19 @@ Ottava_bracket::print (SCM smob) Y_AXIS, Offset (bracket_span_points.length (), 0), edge_height, empty, - flare, shorten); + flare, Drul_array (0, 0)); /* - The vertical lines should not take space, for the following scenario: - - 8 -----+ - o | - | - | - - - Just a small amount, yes. In tight situations, it is even - possible to center the `8' directly below the note, dropping the - ottava line completely... - + * The vertical lines should not take space, for the following scenario: + * + * 8 -----+ + * o | + * | + * | + * + * Just a small amount, yes. In tight situations, it is even + * possible to center the `8' directly below the note, dropping the + * ottava line completely... */ b = Stencil (Box (b.extent (X_AXIS),