lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outside-staff-padding: add just one pad; issue 2910 (issue 10329043)


From: k-ohara5a5a
Subject: Re: outside-staff-padding: add just one pad; issue 2910 (issue 10329043)
Date: Mon, 02 Sep 2013 20:10:36 +0000

Reviewers: Janek Warchol,

Message:
On 2013/09/01 16:54:00, Janek Warchol wrote:
Could you add some information in the commit message explaining why
had you
changed the default values?

I didn't think anyone would care.  I added some sentences above.
We were trying to adjust padding values to remove problems caused by the
skyline-spacing, but had not yet realized that the padding was being
inconsistently applied by the new code.

Description:
outside-staff-padding: just one pad; issue 2910

When two grobs using 'outside-staff-padding are placed
against each other, use the larger of the two grobs'
values of 'outside-staff-padding.
Same for 'outside-staff-horizon-padding.

Commit 28f32949 started to place two pads between outside-staff items,
but just one pad to the staff. The C-code-default value for
'outside-staff-padding was differed between uses in the code.

Since then, some padding values were defined for individual grobs. These
values are no longer needed.

Please review this at https://codereview.appspot.com/10329043/

Affected files:
  M lily/axis-group-interface.cc
  M scm/define-grobs.scm


Index: lily/axis-group-interface.cc
diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc
index 0d786c3a2959aa201470f761c27ee3cd6a98645d..133314d5e798f810c095abd1bab3f2e06b6694d3 100644
--- a/lily/axis-group-interface.cc
+++ b/lily/axis-group-interface.cc
@@ -672,8 +672,8 @@ avoid_outside_staff_collisions (Grob *elt,
   for (vsize j = 0; j < other_v_skylines.size (); j++)
     {
       Skyline_pair const &v_other = other_v_skylines[j];
-      Real pad = (padding + other_padding[j]);
-      Real horizon_pad = (horizon_padding + other_horizon_padding[j]);
+      Real pad = max (padding, other_padding[j]);
+      Real horizon_pad = max (horizon_padding, other_horizon_padding[j]);

       // We need to push elt up by at least this much to be above v_other.
Real up = (*v_skyline)[DOWN].distance (v_other[UP], horizon_pad) + pad;
@@ -762,7 +762,9 @@ add_grobs_of_one_priority (Grob *me,
         {
           Grob *elt = elements[i];
           Real padding
- = robust_scm2double (elt->get_property ("outside-staff-padding"), 0.25); + = robust_scm2double (elt->get_property ("outside-staff-padding"),
+                                 Axis_group_interface
+                                 ::get_default_outside_staff_padding ());
           Real horizon_padding
= robust_scm2double (elt->get_property ("outside-staff-horizontal-padding"), 0.0);
           Interval x_extent = elt->extent (x_common, X_AXIS);
Index: scm/define-grobs.scm
diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
index 86bf7c15a931d0b045cf088f3b8b8a015c99dc7f..2ce6df1829dbb7401bf80bdbe8f293128999ecad 100644
--- a/scm/define-grobs.scm
+++ b/scm/define-grobs.scm
@@ -812,7 +812,6 @@
         (direction . ,DOWN)
         (minimum-space . 1.2)
         (outside-staff-priority . 250)
-        (outside-staff-padding . 0.6)
         (padding . 0.6)
         (side-axis . ,Y)
         (slur-padding . 0.3)
@@ -1412,7 +1411,6 @@
         (font-encoding . fetaText)
         (font-size . -2)
         (outside-staff-horizontal-padding . 0.5)
-        (outside-staff-padding . 0.5)
         (outside-staff-priority . 750)
         (self-alignment-X . ,CENTER)
         (side-axis . ,Y)
@@ -1804,7 +1802,7 @@
         (extra-spacing-width . (+inf.0 . -inf.0))
         (font-size . 2)
         (non-musical . #t)
-        (outside-staff-horizontal-padding . 0.12)
+        (outside-staff-horizontal-padding . 0.2)
         (outside-staff-priority . 1500)
         (padding . 0.8)
         (self-alignment-X . ,CENTER)
@@ -2352,7 +2350,7 @@
         (cross-staff . ,script-or-side-position-cross-staff)
         (direction . ,DOWN)
         (extra-spacing-width . (+inf.0 . -inf.0))
-        (outside-staff-horizontal-padding . 0.12)
+        (outside-staff-horizontal-padding . 0.2)
         (outside-staff-priority . 450)

         ;; sync with Fingering ?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]