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) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 | 6 |
7 LilyPond is free software: you can redistribute it and/or modify | 7 LilyPond is free software: you can redistribute it and/or modify |
8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
9 the Free Software Foundation, either version 3 of the License, or | 9 the Free Software Foundation, either version 3 of the License, or |
10 (at your option) any later version. | 10 (at your option) any later version. |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 /* | 490 /* |
491 TODO: | 491 TODO: |
492 | 492 |
493 - should make sliding criterion, should flatten ties if | 493 - should make sliding criterion, should flatten ties if |
494 | 494 |
495 - they're just the wrong (ie. touching line at top & bottom) | 495 - they're just the wrong (ie. touching line at top & bottom) |
496 size. | 496 size. |
497 | 497 |
498 */ | 498 */ |
499 Interval staff_span = | 499 Interval staff_span |
500 Staff_symbol_referencer::staff_span (details_.staff_symbol_referencer_); | 500 = Staff_symbol_referencer::staff_span (details_.staff_symbol_referencer_
); |
501 staff_span.widen (-1); | 501 staff_span.widen (-1); |
502 bool const within_staff = staff_span.contains(pos); | 502 bool const within_staff = staff_span.contains (pos); |
503 if (head_positions_slice (columns[LEFT]).contains (pos) | 503 if (head_positions_slice (columns[LEFT]).contains (pos) |
504 || head_positions_slice (columns[RIGHT]).contains (pos) | 504 || head_positions_slice (columns[RIGHT]).contains (pos) |
505 || within_staff) | 505 || within_staff) |
506 { | 506 { |
507 if (h < details_.intra_space_threshold_ * 0.5 * details_.staff_space_) | 507 if (h < details_.intra_space_threshold_ * 0.5 * details_.staff_space_) |
508 { | 508 { |
509 if (Staff_symbol_referencer::on_line (details_.staff_symbol_refere
ncer_, pos)) | 509 if (Staff_symbol_referencer::on_line (details_.staff_symbol_refere
ncer_, pos)) |
510 { | 510 { |
511 conf->delta_y_ += dir * | 511 conf->delta_y_ += dir * |
512 details_.tip_staff_line_clearance_ * 0.5 * d
etails_.staff_space_; | 512 details_.tip_staff_line_clearance_ * 0.5 * d
etails_.staff_space_; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 conf->add_score (details_.min_length_penalty_factor_ | 713 conf->add_score (details_.min_length_penalty_factor_ |
714 * length_penalty, "minlength"); | 714 * length_penalty, "minlength"); |
715 | 715 |
716 Real tip_pos = conf->position_ + conf->delta_y_ / 0.5 * details_.staff_space_; | 716 Real tip_pos = conf->position_ + conf->delta_y_ / 0.5 * details_.staff_space_; |
717 Real tip_y = tip_pos * details_.staff_space_ * 0.5; | 717 Real tip_y = tip_pos * details_.staff_space_ * 0.5; |
718 Real height = conf->height (details_); | 718 Real height = conf->height (details_); |
719 | 719 |
720 Real top_y = tip_y + conf->dir_ * height; | 720 Real top_y = tip_y + conf->dir_ * height; |
721 Real top_pos = 2 * top_y / details_.staff_space_; | 721 Real top_pos = 2 * top_y / details_.staff_space_; |
722 Real round_top_pos = rint (top_pos); | 722 Real round_top_pos = rint (top_pos); |
723 Interval staff_span = | 723 Interval staff_span |
724 Staff_symbol_referencer::staff_span (details_.staff_symbol_referencer_); | 724 = Staff_symbol_referencer::staff_span (details_.staff_symbol_referencer_); |
725 if (Staff_symbol_referencer::on_line (details_.staff_symbol_referencer_, | 725 if (Staff_symbol_referencer::on_line (details_.staff_symbol_referencer_, |
726 int (round_top_pos)) | 726 int (round_top_pos)) |
727 && staff_span[UP] * 0.5 > top_y) | 727 && staff_span[UP] * 0.5 > top_y) |
728 { | 728 { |
729 conf->add_score (details_.staff_line_collision_penalty_ | 729 conf->add_score (details_.staff_line_collision_penalty_ |
730 * peak_around (0.1 * details_.center_staff_line_clearance
_, | 730 * peak_around (0.1 * details_.center_staff_line_clearance
_, |
731 details_.center_staff_line_clearance_, | 731 details_.center_staff_line_clearance_, |
732 fabs (top_pos - round_top_pos)), | 732 fabs (top_pos - round_top_pos)), |
733 "line center"); | 733 "line center"); |
734 } | 734 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 { | 1222 { |
1223 for (vsize i = 0; i < base.size (); i++) | 1223 for (vsize i = 0; i < base.size (); i++) |
1224 { | 1224 { |
1225 string card = base.complete_tie_card (i); | 1225 string card = base.complete_tie_card (i); |
1226 specifications_[i].tie_grob_->set_property ("annotation", | 1226 specifications_[i].tie_grob_->set_property ("annotation", |
1227 ly_string2scm (card)); | 1227 ly_string2scm (card)); |
1228 } | 1228 } |
1229 } | 1229 } |
1230 #endif | 1230 #endif |
1231 } | 1231 } |
LEFT | RIGHT |