]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/regression/multi-measure-rest-center.ly: new file.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 22 Oct 2002 22:14:06 +0000 (22:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 22 Oct 2002 22:14:06 +0000 (22:14 +0000)
* lily/multi-measure-rest.cc (big_rest): multi measure rest was
off horizontally by 0.05 ss. Fixed.

ChangeLog
input/regression/multi-measure-rest-center.ly [new file with mode: 0644]
lily/multi-measure-rest.cc
lily/side-position-interface.cc
scm/grob-description.scm

index 46bd11fa043681091e1d8d70d5e68527358d39a0..a972e2c5bbd70eaf497b8c07ee518e397a0e2055 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-23  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * 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  <hanwen@cs.uu.nl>
 
        * 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 (file)
index 0000000..35c00ff
--- /dev/null
@@ -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 } 
+}
+        
index 127b35547afea21d1f25df16c4ed58db0b96b64d..e0a44196a0053e772222289682acd9fa92239150 100644 (file)
@@ -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");
 
index 24f3abbc997646f19084b0a27822052fcd16a419..d3b0f2a9e13cc2c18a4da13d71788b898b1bf175 100644 (file)
@@ -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");
index e33ed121315db26a1b6a95782a872eca04e2698e..527123858422c5ab2274b5fddd90f7e8e9b97140 100644 (file)
        (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))))
        ))