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) 2007--2015 Joe Neeman <joeneeman@gmail.com> | 4 Copyright (C) 2007--2015 Joe Neeman <joeneeman@gmail.com> |
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 Spacing_interface::right_column (Grob *me) | 106 Spacing_interface::right_column (Grob *me) |
107 { | 107 { |
108 if (!me->is_live ()) | 108 if (!me->is_live ()) |
109 return 0; | 109 return 0; |
110 | 110 |
111 Grob_array *a = unsmob<Grob_array> (me->get_object ("right-items")); | 111 Grob_array *a = unsmob<Grob_array> (me->get_object ("right-items")); |
112 Item *mincol = 0; | 112 Item *mincol = 0; |
113 int min_rank = INT_MAX; | 113 int min_rank = INT_MAX; |
114 for (vsize i = 0; a && i < a->size (); i++) | 114 for (vsize i = 0; a && i < a->size (); i++) |
115 { | 115 { |
116 Item *ri = a->item (i); | 116 Item *ri = dynamic_cast<Item *> (a->grob (i)); |
117 Item *col = ri->get_column (); | 117 Item *col = ri->get_column (); |
118 | 118 |
119 int rank = Paper_column::get_rank (col); | 119 int rank = Paper_column::get_rank (col); |
120 | 120 |
121 if (rank < min_rank) | 121 if (rank < min_rank) |
122 { | 122 { |
123 min_rank = rank; | 123 min_rank = rank; |
124 mincol = col; | 124 mincol = col; |
125 } | 125 } |
126 } | 126 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 218 } |
219 | 219 |
220 ADD_INTERFACE (Spacing_interface, | 220 ADD_INTERFACE (Spacing_interface, |
221 "This object calculates the desired and minimum distances" | 221 "This object calculates the desired and minimum distances" |
222 " between two columns.", | 222 " between two columns.", |
223 | 223 |
224 /* properties */ | 224 /* properties */ |
225 "left-items " | 225 "left-items " |
226 "right-items " | 226 "right-items " |
227 ); | 227 ); |
OLD | NEW |