LEFT | RIGHT |
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) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 Jan Nieuwenhuizen <janneke@gnu.org> | 5 Jan Nieuwenhuizen <janneke@gnu.org> |
6 | 6 |
7 TODO: This is way too hairy | 7 TODO: This is way too hairy |
8 | 8 |
9 TODO: fix naming. | 9 TODO: fix naming. |
10 | 10 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 extpos[UP] = -inf; | 218 extpos[UP] = -inf; |
219 | 219 |
220 Drul_array<Grob *> exthead (0, 0); | 220 Drul_array<Grob *> exthead (0, 0); |
221 extract_grob_set (me, "note-heads", heads); | 221 extract_grob_set (me, "note-heads", heads); |
222 | 222 |
223 for (vsize i = heads.size (); i--;) | 223 for (vsize i = heads.size (); i--;) |
224 { | 224 { |
225 Grob *n = heads[i]; | 225 Grob *n = heads[i]; |
226 int p = Staff_symbol_referencer::get_rounded_position (n); | 226 int p = Staff_symbol_referencer::get_rounded_position (n); |
227 | 227 |
228 for(LEFT_and_RIGHT(d)) | 228 for (LEFT_and_RIGHT (d)) |
229 { | 229 { |
230 if (d * p > d * extpos[d]) | 230 if (d * p > d * extpos[d]) |
231 { | 231 { |
232 exthead[d] = n; | 232 exthead[d] = n; |
233 extpos[d] = p; | 233 extpos[d] = p; |
234 } | 234 } |
235 } | 235 } |
236 } | 236 } |
237 return exthead; | 237 return exthead; |
238 } | 238 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 Grob *beam = unsmob_grob (me->get_object ("beam")); | 310 Grob *beam = unsmob_grob (me->get_object ("beam")); |
311 | 311 |
312 Interval iv = internal_height (me, false); | 312 Interval iv = internal_height (me, false); |
313 | 313 |
314 if (!beam) | 314 if (!beam) |
315 return iv; | 315 return iv; |
316 if (calc_beam) | 316 if (calc_beam) |
317 { | 317 { |
318 Interval overshoot; | 318 Interval overshoot; |
319 Direction dir = get_grob_direction (me); | 319 Direction dir = get_grob_direction (me); |
320 for(DOWN_and_UP(d)) | 320 for (DOWN_and_UP (d)) |
321 overshoot[d] = d == dir ? dir * infinity_f : iv[d]; | 321 overshoot[d] = d == dir ? dir * infinity_f : iv[d]; |
322 | 322 |
323 vector<Interval> heights; | 323 vector<Interval> heights; |
324 vector<Grob *> my_stems; | 324 vector<Grob *> my_stems; |
325 extract_grob_set (beam, "normal-stems", normal_stems); | 325 extract_grob_set (beam, "normal-stems", normal_stems); |
326 for (vsize i = 0; i < normal_stems.size (); i++) | 326 for (vsize i = 0; i < normal_stems.size (); i++) |
327 if (get_grob_direction (normal_stems[i]) == dir) | 327 if (get_grob_direction (normal_stems[i]) == dir) |
328 { | 328 { |
329 if (normal_stems[i] != me) | 329 if (normal_stems[i] != me) |
330 heights.push_back (Stem::internal_pure_height (normal_stems[i], fa
lse)); | 330 heights.push_back (Stem::internal_pure_height (normal_stems[i], fa
lse)); |
(...skipping 28 matching lines...) Expand all Loading... |
359 } | 359 } |
360 | 360 |
361 return iv; | 361 return iv; |
362 } | 362 } |
363 | 363 |
364 void | 364 void |
365 Stem::cache_pure_height (Grob *me, Interval iv, Interval my_iv) | 365 Stem::cache_pure_height (Grob *me, Interval iv, Interval my_iv) |
366 { | 366 { |
367 Interval overshoot; | 367 Interval overshoot; |
368 Direction dir = get_grob_direction (me); | 368 Direction dir = get_grob_direction (me); |
369 for(DOWN_and_UP(d)) | 369 for (DOWN_and_UP (d)) |
370 overshoot[d] = d == dir ? dir * infinity_f : my_iv[d]; | 370 overshoot[d] = d == dir ? dir * infinity_f : my_iv[d]; |
371 | 371 |
372 iv.intersect (overshoot); | 372 iv.intersect (overshoot); |
373 dynamic_cast<Item *> (me)->cache_pure_height (iv); | 373 dynamic_cast<Item *> (me)->cache_pure_height (iv); |
374 } | 374 } |
375 | 375 |
376 MAKE_SCHEME_CALLBACK (Stem, calc_stem_end_position, 1) | 376 MAKE_SCHEME_CALLBACK (Stem, calc_stem_end_position, 1) |
377 SCM | 377 SCM |
378 Stem::calc_stem_end_position (SCM smob) | 378 Stem::calc_stem_end_position (SCM smob) |
379 { | 379 { |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 ideal_y_ = shortest_y_ = 0; | 1145 ideal_y_ = shortest_y_ = 0; |
1146 dir_ = CENTER; | 1146 dir_ = CENTER; |
1147 } | 1147 } |
1148 | 1148 |
1149 void | 1149 void |
1150 Stem_info::scale (Real x) | 1150 Stem_info::scale (Real x) |
1151 { | 1151 { |
1152 ideal_y_ *= x; | 1152 ideal_y_ *= x; |
1153 shortest_y_ *= x; | 1153 shortest_y_ *= x; |
1154 } | 1154 } |
LEFT | RIGHT |