Left: | ||
Right: |
OLD | NEW |
---|---|
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) 1997--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2019 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 { | 146 { |
147 Stencil b (a); | 147 Stencil b (a); |
148 b.translate_axis (beam_translation * i * dir * -1, Y_AXIS); | 148 b.translate_axis (beam_translation * i * dir * -1, Y_AXIS); |
149 mol.add_stencil (b); | 149 mol.add_stencil (b); |
150 } | 150 } |
151 return mol; | 151 return mol; |
152 } | 152 } |
153 | 153 |
154 MAKE_SCHEME_CALLBACK (Stem_tremolo, pure_height, 3); | 154 MAKE_SCHEME_CALLBACK (Stem_tremolo, pure_height, 3); |
155 SCM | 155 SCM |
156 Stem_tremolo::pure_height (SCM smob, SCM, SCM) | 156 Stem_tremolo::pure_height (SCM smob, SCM, SCM) |
Keith
2019/04/03 08:16:22
Stem_tremolo::pure_height (SCM smob, SCM /*start*/
| |
157 { | 157 { |
158 Item *me = unsmob<Item> (smob); | 158 Item *me = unsmob<Item> (smob); |
159 | 159 |
160 /* | 160 /* |
161 Cannot use the real slope, since it looks at the Beam. | 161 Cannot use the real slope, since it looks at the Beam. |
162 */ | 162 */ |
163 Stencil s1 (untranslated_stencil (me, 0.35)); | 163 Stencil s1 (untranslated_stencil (me, 0.35)); |
164 Item *stem = unsmob<Item> (me->get_object ("stem")); | 164 Item *stem = unsmob<Item> (me->get_object ("stem")); |
165 if (!stem) | 165 if (!stem) |
166 return ly_interval2scm (s1.extent (Y_AXIS)); | 166 return ly_interval2scm (s1.extent (Y_AXIS)); |
167 | 167 |
168 Direction dir = get_grob_direction (me); | 168 Direction dir = get_grob_direction (me); |
169 | 169 |
170 Spanner *beam = Stem::get_beam (stem); | 170 Spanner *beam = Stem::get_beam (stem); |
171 | 171 |
172 if (!beam) | 172 if (!beam) |
173 return ly_interval2scm (s1.extent (Y_AXIS)); | 173 return ly_interval2scm (s1.extent (Y_AXIS)); |
174 | 174 |
175 Interval ph = stem->pure_y_extent (stem, 0, INT_MAX); | 175 Interval ph = stem->pure_y_extent (stem, 0, INT_MAX); |
Keith
2019/04/03 08:16:22
The code clearly assumed that 'ph' would never be
Keith
2019/04/03 17:10:50
My suggested change to return s1.extent will proba
| |
176 Stem_info si = Stem::get_stem_info (stem); | 176 Stem_info si = Stem::get_stem_info (stem); |
177 ph[-dir] = si.shortest_y_; | 177 ph.add_point (si.shortest_y_); |
Keith
2019/04/03 08:16:22
shortest_y is the endpoint of the stem (including
| |
178 int beam_count = Stem::beam_multiplicity (stem).length () + 1; | 178 int beam_count = Stem::beam_multiplicity (stem).length () + 1; |
179 Real beam_translation = get_beam_translation (me); | 179 Real beam_translation = get_beam_translation (me); |
180 | 180 |
181 ph = ph - dir * max (beam_count, 1) * beam_translation; | 181 ph = ph - dir * max (beam_count, 1) * beam_translation; |
182 ph = ph - ph.center (); | 182 ph = ph - ph.center (); |
Keith
2019/04/03 08:16:22
There is the obvious problem that line 182 destroy
dak
2019/04/08 16:17:16
This is likely the famous "somebody must have been
| |
183 | 183 |
184 return ly_interval2scm (ph); | 184 return ly_interval2scm (ph); |
185 } | 185 } |
186 | 186 |
187 MAKE_SCHEME_CALLBACK (Stem_tremolo, width, 1); | 187 MAKE_SCHEME_CALLBACK (Stem_tremolo, width, 1); |
188 SCM | 188 SCM |
189 Stem_tremolo::width (SCM smob) | 189 Stem_tremolo::width (SCM smob) |
190 { | 190 { |
191 Grob *me = unsmob<Grob> (smob); | 191 Grob *me = unsmob<Grob> (smob); |
192 | 192 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 /* properties */ | 350 /* properties */ |
351 "beam-thickness " | 351 "beam-thickness " |
352 "beam-width " | 352 "beam-width " |
353 "direction " | 353 "direction " |
354 "flag-count " | 354 "flag-count " |
355 "length-fraction " | 355 "length-fraction " |
356 "stem " | 356 "stem " |
357 "shape " | 357 "shape " |
358 "slope " | 358 "slope " |
359 ); | 359 ); |
OLD | NEW |