LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 /* | 75 /* |
76 Return the width of ME given that we are considering the object on | 76 Return the width of ME given that we are considering the object on |
77 the LEFT. | 77 the LEFT. |
78 */ | 78 */ |
79 Skyline | 79 Skyline |
80 Separation_item::conditional_skyline (Grob *me, Grob *left) | 80 Separation_item::conditional_skyline (Grob *me, Grob *left) |
81 { | 81 { |
82 vector<Box> bs = boxes (me, left); | 82 vector<Box> bs = boxes (me, left); |
83 Real horizon_padding = robust_scm2double (me->get_property ("skyline-vertical-
padding"), 0.0); | 83 return Skyline (bs, Y_AXIS, LEFT); |
84 return Skyline (bs, horizon_padding, Y_AXIS, LEFT); | |
85 } | 84 } |
86 | 85 |
87 MAKE_SCHEME_CALLBACK (Separation_item, calc_skylines, 1); | 86 MAKE_SCHEME_CALLBACK (Separation_item, calc_skylines, 1); |
88 SCM | 87 SCM |
89 Separation_item::calc_skylines (SCM smob) | 88 Separation_item::calc_skylines (SCM smob) |
90 { | 89 { |
91 Item *me = unsmob_item (smob); | 90 Item *me = unsmob_item (smob); |
92 vector<Box> bs = boxes (me, 0); | 91 vector<Box> bs = boxes (me, 0); |
93 Real horizon_padding = robust_scm2double (me->get_property ("skyline-vertical-
padding"), 0.0); | 92 Skyline_pair sp (bs, Y_AXIS); |
94 return Skyline_pair (bs, horizon_padding, Y_AXIS).smobbed_copy (); | 93 /* |
| 94 TODO: We need to decide if padding is 'intrinsic' |
| 95 to a skyline or if it is something that is only added on in |
| 96 distance calculations. Here, we make it intrinsic, which copies |
| 97 the behavior from the old code but no longer corresponds to how |
| 98 vertical skylines are handled (where padding is not built into |
| 99 the skyline). |
| 100 */ |
| 101 Real vp = robust_scm2double (me->get_property ("skyline-vertical-padding"), 0.
0); |
| 102 sp[LEFT] = sp[LEFT].padded (vp); |
| 103 sp[RIGHT] = sp[RIGHT].padded (vp); |
| 104 return sp.smobbed_copy (); |
95 } | 105 } |
96 | 106 |
97 /* if left is non-NULL, get the boxes corresponding to the | 107 /* if left is non-NULL, get the boxes corresponding to the |
98 conditional-elements (conditioned on the grob LEFT). This | 108 conditional-elements (conditioned on the grob LEFT). This |
99 sounds more general than it is: conditional-elements are | 109 sounds more general than it is: conditional-elements are |
100 always accidentals attached to a tied note. | 110 always accidentals attached to a tied note. |
101 */ | 111 */ |
102 vector<Box> | 112 vector<Box> |
103 Separation_item::boxes (Grob *me, Grob *left) | 113 Separation_item::boxes (Grob *me, Grob *left) |
104 { | 114 { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 "Item that computes widths to generate spacing rods.", | 183 "Item that computes widths to generate spacing rods.", |
174 | 184 |
175 /* properties */ | 185 /* properties */ |
176 "X-extent " | 186 "X-extent " |
177 "conditional-elements " | 187 "conditional-elements " |
178 "elements " | 188 "elements " |
179 "padding " | 189 "padding " |
180 "horizontal-skylines " | 190 "horizontal-skylines " |
181 "skyline-vertical-padding " | 191 "skyline-vertical-padding " |
182 ); | 192 ); |
LEFT | RIGHT |