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) 1996--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1996--2020 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 | 549 |
550 if (is_harmonic_centered) | 550 if (is_harmonic_centered) |
551 amount | 551 amount |
552 = hed->extent (hed, X_AXIS).linear_combination (CENTER) | 552 = hed->extent (hed, X_AXIS).linear_combination (CENTER) |
553 - heads[i]->extent (heads[i], X_AXIS).linear_combination (CENTER); | 553 - heads[i]->extent (heads[i], X_AXIS).linear_combination (CENTER); |
554 | 554 |
555 if (!std::isnan (amount)) // empty heads can produce NaN | 555 if (!std::isnan (amount)) // empty heads can produce NaN |
556 heads[i]->translate_axis (amount, X_AXIS); | 556 heads[i]->translate_axis (amount, X_AXIS); |
557 } | 557 } |
558 bool parity = true; | 558 bool parity = true; |
559 Real lastpos = Real (Staff_symbol_referencer::get_position (heads[0])); | 559 Real lastpos |
| 560 = static_cast<Real> (Staff_symbol_referencer::get_position (heads[0])); |
560 int threshold = robust_scm2int (me->get_property ("note-collision-threshold"),
1); | 561 int threshold = robust_scm2int (me->get_property ("note-collision-threshold"),
1); |
561 for (vsize i = 1; i < heads.size (); i++) | 562 for (vsize i = 1; i < heads.size (); i++) |
562 { | 563 { |
563 Real p = Staff_symbol_referencer::get_position (heads[i]); | 564 Real p = Staff_symbol_referencer::get_position (heads[i]); |
564 Real dy = fabs (lastpos - p); | 565 Real dy = fabs (lastpos - p); |
565 | 566 |
566 /* | 567 /* |
567 dy should always be 0.5, 0.0, 1.0, but provide safety margin | 568 dy should always be 0.5, 0.0, 1.0, but provide safety margin |
568 for rounding errors. | 569 for rounding errors. |
569 */ | 570 */ |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 ideal_y_ = shortest_y_ = 0; | 1209 ideal_y_ = shortest_y_ = 0; |
1209 dir_ = CENTER; | 1210 dir_ = CENTER; |
1210 } | 1211 } |
1211 | 1212 |
1212 void | 1213 void |
1213 Stem_info::scale (Real x) | 1214 Stem_info::scale (Real x) |
1214 { | 1215 { |
1215 ideal_y_ *= x; | 1216 ideal_y_ *= x; |
1216 shortest_y_ *= x; | 1217 shortest_y_ *= x; |
1217 } | 1218 } |
OLD | NEW |