Left: | ||
Right: |
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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 void | 120 void |
121 Stem::set_stem_positions (Grob *me, Real se) | 121 Stem::set_stem_positions (Grob *me, Real se) |
122 { | 122 { |
123 // todo: margins | 123 // todo: margins |
124 Direction d = get_grob_direction (me); | 124 Direction d = get_grob_direction (me); |
125 | 125 |
126 Grob *beam = unsmob_grob (me->get_object ("beam")); | 126 Grob *beam = unsmob_grob (me->get_object ("beam")); |
127 if (d && d * head_positions (me)[get_grob_direction (me)] >= se * d) | 127 if (d && d * head_positions (me)[get_grob_direction (me)] >= se * d) |
128 me->warning (_ ("weird stem size, check for narrow beams")); | 128 me->warning (_ ("weird stem size, check for narrow beams")); |
129 | 129 |
130 Interval height = me->pure_height (me, 0, INT_MAX); | 130 // trigger note collision mechanisms |
131 Real stem_beg = internal_calc_stem_begin_position (me, false); | |
Keith
2012/04/02 07:42:55
I'm assuming something within calc_stem_begin_posi
MikeSol
2012/04/02 07:48:11
Yup. It allows calc_stem_position to skip all of
Keith
2012/04/04 04:02:47
That was nonsense. Note-collision resolution happ
| |
131 Real staff_space = Staff_symbol_referencer::staff_space (me); | 132 Real staff_space = Staff_symbol_referencer::staff_space (me); |
132 Real half_space = staff_space * 0.5; | 133 Real half_space = staff_space * 0.5; |
133 | 134 |
135 Interval height; | |
136 height[-d] = stem_beg * half_space; | |
134 height[d] = se * half_space + beam_end_corrective (me); | 137 height[d] = se * half_space + beam_end_corrective (me); |
135 | 138 |
136 Real stemlet_length = robust_scm2double (me->get_property ("stemlet-length"), | 139 Real stemlet_length = robust_scm2double (me->get_property ("stemlet-length"), |
137 0.0); | 140 0.0); |
138 bool stemlet = stemlet_length > 0.0; | 141 bool stemlet = stemlet_length > 0.0; |
139 | 142 |
140 Grob *lh = get_reference_head (me); | 143 Grob *lh = get_reference_head (me); |
141 | 144 |
142 if (!lh) | 145 if (!lh) |
143 { | 146 { |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
780 Grob *lh = get_reference_head (me); | 783 Grob *lh = get_reference_head (me); |
781 | 784 |
782 if (!lh) | 785 if (!lh) |
783 return 0.0; | 786 return 0.0; |
784 | 787 |
785 Real pos = Staff_symbol_referencer::get_position (lh); | 788 Real pos = Staff_symbol_referencer::get_position (lh); |
786 | 789 |
787 if (Grob *head = support_head (me)) | 790 if (Grob *head = support_head (me)) |
788 { | 791 { |
789 Interval head_height = head->extent (head, Y_AXIS); | 792 Interval head_height = head->extent (head, Y_AXIS); |
790 // trigger positioning of stems in note column in case of merge | |
791 if (me->get_parent (X_AXIS) | |
792 && me->get_parent (X_AXIS)->get_parent (X_AXIS)) | |
793 (void) me->get_parent (X_AXIS) | |
794 ->extent (me->get_parent (X_AXIS) | |
795 ->get_parent (X_AXIS), X_AXIS); | |
796 else | |
797 me->programming_error ("Stem doesn't belong to NoteColumn or PaperColumn ."); | |
798 Real y_attach = Note_head::stem_attachment_coordinate (head, Y_AXIS); | 793 Real y_attach = Note_head::stem_attachment_coordinate (head, Y_AXIS); |
799 | 794 |
800 y_attach = head_height.linear_combination (y_attach); | 795 y_attach = head_height.linear_combination (y_attach); |
801 pos += d * y_attach * 2 / ss; | 796 pos += d * y_attach * 2 / ss; |
802 } | 797 } |
803 | 798 |
804 return pos; | 799 return pos; |
805 } | 800 } |
806 | 801 |
807 bool | 802 bool |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1156 ideal_y_ = shortest_y_ = 0; | 1151 ideal_y_ = shortest_y_ = 0; |
1157 dir_ = CENTER; | 1152 dir_ = CENTER; |
1158 } | 1153 } |
1159 | 1154 |
1160 void | 1155 void |
1161 Stem_info::scale (Real x) | 1156 Stem_info::scale (Real x) |
1162 { | 1157 { |
1163 ideal_y_ *= x; | 1158 ideal_y_ *= x; |
1164 shortest_y_ *= x; | 1159 shortest_y_ *= x; |
1165 } | 1160 } |
LEFT | RIGHT |