From 1021b8a64727e747c36d9e56ab8cefa93b2ea5d1 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 22 Oct 2002 22:14:06 +0000 Subject: [PATCH] * input/regression/multi-measure-rest-center.ly: new file. * lily/multi-measure-rest.cc (big_rest): multi measure rest was off horizontally by 0.05 ss. Fixed. --- ChangeLog | 7 +++++++ input/regression/multi-measure-rest-center.ly | 18 ++++++++++++++++++ lily/multi-measure-rest.cc | 19 +++++++++++-------- lily/side-position-interface.cc | 12 ++++++------ scm/grob-description.scm | 3 ++- 5 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 input/regression/multi-measure-rest-center.ly diff --git a/ChangeLog b/ChangeLog index 46bd11fa04..a972e2c5bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-10-23 Han-Wen Nienhuys + + * input/regression/multi-measure-rest-center.ly: new file. + + * lily/multi-measure-rest.cc (big_rest): multi measure rest was + off horizontally by 0.05 ss. Fixed. + 2002-10-22 Han-Wen Nienhuys * lily/tie.cc (get_control_points): also avoid staff lines on the diff --git a/input/regression/multi-measure-rest-center.ly b/input/regression/multi-measure-rest-center.ly new file mode 100644 index 0000000000..35c00ff5b8 --- /dev/null +++ b/input/regression/multi-measure-rest-center.ly @@ -0,0 +1,18 @@ +\header +{ + texidoc = "The multimeasure rest is centered exactly between bar lines." + +} + +\score { + \notes + { + \property Score.skipBars = ##t + \property Staff.BarLine \set #'hair-thickness = #7.5 + \property Staff.MultiMeasureRest \set #'hair-thickness = #10 + + c'1 R1*20 c'1 + } + \paper { linewidth = -1.0 } +} + diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 127b35547a..e0a44196a0 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -175,19 +175,22 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) Molecule Multi_measure_rest::big_rest (Grob *me, Real width) { - Real thick = gh_scm2double (me->get_grob_property ("thickness")); + Real tthick = gh_scm2double (me->get_grob_property ("thick-thickness")); + Real hair_thick = gh_scm2double (me->get_grob_property ("hair-thickness")); + + Real ss = Staff_symbol_referencer::staff_space (me); Real slt = me->get_paper ()->get_var ("linethickness"); - Real y = slt * thick/2 * ss; - Box b(Interval (0, width), Interval (-y, y)); - Real ythick = slt * ss; + Real y = slt * tthick/2 * ss; + Real ythick = hair_thick * slt * ss; + Box b(Interval (0, width - 2 * ythick), Interval (-y, y)); Molecule m = Lookup::filledbox (b); - Molecule yb = Lookup::filledbox (Box (Interval (-ythick, ythick), Interval (-ss, ss))); + Molecule yb = Lookup::filledbox (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss))); - m.add_at_edge (X_AXIS, RIGHT, yb, -ythick); - m.add_at_edge (X_AXIS, LEFT, yb, -ythick); + m.add_at_edge (X_AXIS, RIGHT, yb, 0); + m.add_at_edge (X_AXIS, LEFT, yb, 0); m.align_to (X_AXIS, LEFT); @@ -341,5 +344,5 @@ Multi_measure_rest::set_spacing_rods (SCM smob) ADD_INTERFACE (Multi_measure_rest,"multi-measure-rest-interface", "A rest that spans a whole number of measures.\n", - "expand-limit measure-count thickness use-breve-rest"); + "expand-limit measure-count hair-thickness thick-thickness use-breve-rest"); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 24f3abbc99..d3b0f2a9e1 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -162,10 +162,10 @@ Side_position_interface::quantised_position (SCM element_smob, SCM) { Grob *me = unsmob_grob (element_smob); - Direction d = Side_position_interface::get_direction (me); - if (Staff_symbol_referencer::has_interface (me)) + Grob * stsym = Staff_symbol_referencer::get_staff_symbol (me); + if (stsym) { Real p = Staff_symbol_referencer::get_position (me); Real rp = directed_round (p, d); @@ -271,8 +271,8 @@ Side_position_interface::supported_b (Grob*me) ADD_INTERFACE (Side_position_interface,"side-position-interface", - "Position a victim object (this one) next to other objects (the -support). In this case, the direction signifies where to put the -victim object relative to the support (left or right, up or down?) -", + "Position a victim object (this one) next to other objects (the " +"support). In this case, the direction signifies where to put the " +"victim object relative to the support (left or right, up or down?) " +, "side-support-elements direction-source direction side-relative-direction minimum-space padding"); diff --git a/scm/grob-description.scm b/scm/grob-description.scm index e33ed12131..5271238584 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -540,7 +540,8 @@ (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (staff-position . 0) (expand-limit . 10) - (thickness . 6.6) + (thick-thickness . 6.6) + (hair-thickness . 2.0) (padding . 1) (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface spanner-interface)))) )) -- 2.39.2