Left: | ||
Right: |
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) 2009--2011 Joe Neeman <joeneeman@gmail.com> | 4 Copyright (C) 2009--2011 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 if (stencils == SCM_EOL) | 60 if (stencils == SCM_EOL) |
61 continue; | 61 continue; |
62 for (SCM st = stencils; scm_is_pair (st); st = scm_cdr (st)) | 62 for (SCM st = stencils; scm_is_pair (st); st = scm_cdr (st)) |
63 fn_count++; | 63 fn_count++; |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 return fn_count; | 67 return fn_count; |
68 } | 68 } |
69 | 69 |
70 | |
71 SCM | |
72 Page_layout_problem::get_footnotes_from_lines (SCM lines) | |
73 { | |
74 if (lines == SCM_EOL) | |
Bertrand Bordage
2011/10/21 11:52:25
if (!scm_is_pair (lines))
See the new chapter "Sc
| |
75 return SCM_EOL; | |
76 ·· | |
Bertrand Bordage
2011/10/21 11:52:25
Trailing whitespace.
| |
77 bool footnotes_added; | |
78 if (Grob *g = unsmob_grob (scm_car (lines))) | |
79 footnotes_added = g->get_property ("footnote-stencil") != SCM_EOL; | |
Bertrand Bordage
2011/10/21 11:52:25
footnotes_added = scm_is_pair (g->get_property ("f
MikeSol
2011/10/21 12:21:57
Would this work? footnote-stencil's value is a st
Bertrand Bordage
2011/10/21 20:07:37
Of course not :o$ I recommend to_boolean. It ret
Neil Puttock
2011/10/21 23:19:27
Don't do this. to_boolean should only be used wit
dak
2011/10/21 23:40:24
Since when?
It returns true for SCM_BOOL_T and no
| |
80 else if (Prob *p = unsmob_prob (scm_car (lines))) | |
81 footnotes_added = p->get_property ("footnote-stencil") != SCM_EOL; | |
Bertrand Bordage
2011/10/21 11:52:25
Same as before.
| |
82 else | |
83 { | |
84 programming_error ("Systems on a page must be a prob or grob."); | |
85 return SCM_EOL; | |
86 } | |
87 if (!footnotes_added) | |
88 { | |
89 programming_error ("Footnotes must be added to lines before they're retrie ved."); | |
90 return SCM_EOL; | |
91 } | |
92 | |
93 SCM out = SCM_EOL; | |
94 for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s)) | |
95 { | |
96 if (Grob *g = unsmob_grob (scm_car (s))) | |
97 out = scm_cons (g->get_property ("footnote-stencil"), out); | |
98 else if (Prob *p = unsmob_prob (scm_car (s))) | |
99 out = scm_cons (p->get_property ("footnote-stencil"), out); | |
100 else | |
101 programming_error ("Systems on a page must be a prob or grob."); | |
102 } | |
103 | |
104 return scm_reverse (out); | |
105 } | |
106 | |
70 /* | 107 /* |
71 Returns a stencil for the footnote of each system. This stencil may | 108 Adds a footnote stencil to each system. This stencil may |
72 itself be comprised of several footnotes. | 109 itself be comprised of several footnotes. |
73 | 110 |
74 This is a long function, but it seems better to keep it intact rather than | 111 This is a long function, but it seems better to keep it intact rather than |
75 splitting it into parts. | 112 splitting it into parts. |
76 */ | 113 */ |
77 | 114 |
78 SCM | 115 void |
79 Page_layout_problem::get_footnotes_from_lines (SCM lines, int counter, Paper_boo k *pb) | 116 Page_layout_problem::add_footnotes_to_lines (SCM lines, int counter, Paper_book *pb) |
80 { | 117 { |
81 /* | 118 /* |
82 first, we have to see how many footnotes are on this page. | 119 first, we have to see how many footnotes are on this page. |
83 we need to do this first so that we can line them up | 120 we need to do this first so that we can line them up |
84 */ | 121 */ |
85 | 122 |
86 Output_def *paper = pb->paper_; | 123 Output_def *paper = pb->paper_; |
87 | 124 |
88 if (!paper) | 125 if (!paper) |
89 { | 126 { |
90 programming_error ("Cannot get footnotes because there is no valid paper b lock."); | 127 programming_error ("Cannot get footnotes because there is no valid paper b lock."); |
91 return SCM_EOL; | 128 return; |
92 } | 129 } |
93 | 130 |
94 SCM number_footnote_table = pb->top_paper ()->c_variable ("number-footnote-tab le"); | 131 SCM number_footnote_table = pb->top_paper ()->c_variable ("number-footnote-tab le"); |
95 if (!scm_is_pair (number_footnote_table)) | 132 if (!scm_is_pair (number_footnote_table)) |
96 number_footnote_table = SCM_EOL; | 133 number_footnote_table = SCM_EOL; |
97 SCM numbering_function = paper->c_variable ("footnote-numbering-function"); | 134 SCM numbering_function = paper->c_variable ("footnote-numbering-function"); |
98 SCM layout = paper->self_scm (); | 135 SCM layout = paper->self_scm (); |
99 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-page-properti es"), | 136 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-page-properti es"), |
100 paper->self_scm ()); | 137 paper->self_scm ()); |
101 Real padding = robust_scm2double (paper->c_variable ("footnote-padding"), 0.0) ; | 138 Real padding = robust_scm2double (paper->c_variable ("footnote-padding"), 0.0) ; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 for (vsize i = 0; i < fn_count; i++) | 185 for (vsize i = 0; i < fn_count; i++) |
149 { | 186 { |
150 *in_text_tail = scm_cons (footnote_number_markups[i], SCM_EOL); | 187 *in_text_tail = scm_cons (footnote_number_markups[i], SCM_EOL); |
151 in_text_tail = SCM_CDRLOC (*in_text_tail); | 188 in_text_tail = SCM_CDRLOC (*in_text_tail); |
152 footnote_number_stencils[i]->translate_axis (max_length - footnote_number_ stencils[i]->extent (X_AXIS).length (), X_AXIS); | 189 footnote_number_stencils[i]->translate_axis (max_length - footnote_number_ stencils[i]->extent (X_AXIS).length (), X_AXIS); |
153 *tail = scm_cons (footnote_number_stencils[i]->smobbed_copy (), SCM_EOL); | 190 *tail = scm_cons (footnote_number_stencils[i]->smobbed_copy (), SCM_EOL); |
154 tail = SCM_CDRLOC (*tail); | 191 tail = SCM_CDRLOC (*tail); |
155 } | 192 } |
156 // build the footnotes | 193 // build the footnotes |
157 | 194 |
158 SCM footnotes = SCM_EOL; | |
159 | |
160 for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s)) | 195 for (SCM s = lines; scm_is_pair (s); s = scm_cdr (s)) |
161 { | 196 { |
162 // Take care of musical systems. | 197 // Take care of musical systems. |
163 if (Grob *g = unsmob_grob (scm_car (s))) | 198 if (Grob *g = unsmob_grob (scm_car (s))) |
164 { | 199 { |
165 System *sys = dynamic_cast<System *> (g); | 200 System *sys = dynamic_cast<System *> (g); |
166 if (!sys) | 201 if (!sys) |
167 { | 202 { |
168 programming_error ("got a grob for footnotes that wasn't a System" ); | 203 programming_error ("got a grob for footnotes that wasn't a System" ); |
169 continue; | 204 continue; |
170 } | 205 } |
171 Stencil mol; | 206 Stencil mol; |
172 | 207 Stencil in_note_mol; |
173 for (vsize i = 0; i < sys->footnote_grobs ()->size (); i++) | 208 for (vsize i = 0; i < sys->footnote_grobs ()->size (); i++) |
174 { | 209 { |
175 Grob *footnote = sys->footnote_grobs ()->at (i); | 210 Grob *footnote = sys->footnote_grobs ()->at (i); |
176 SCM footnote_markup = footnote->get_property ("footnote-text"); | 211 SCM footnote_markup = footnote->get_property ("footnote-text"); |
177 if (Spanner *orig = dynamic_cast<Spanner *>(footnote)) | 212 if (Spanner *orig = dynamic_cast<Spanner *>(footnote)) |
178 if (orig->is_broken ()) | 213 if (orig->is_broken ()) |
179 footnote_markup = orig->broken_intos_[0]->get_property ("footn ote-text"); | 214 footnote_markup = orig->broken_intos_[0]->get_property ("footn ote-text"); |
180 | 215 |
181 if (!Text_interface::is_markup (footnote_markup)) | |
182 continue; | |
183 | |
184 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-p age-properties"), | 216 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-p age-properties"), |
185 paper->self_scm ()); | 217 paper->self_scm ()); |
186 | 218 |
187 SCM footnote_stl = Text_interface::interpret_markup (paper->self_s cm (), | 219 SCM footnote_stl = Text_interface::interpret_markup (paper->self_s cm (), |
188 props, footno te_markup); | 220 props, footno te_markup); |
189 | 221 |
190 Stencil *footnote_stencil = unsmob_stencil (footnote_stl); | 222 Stencil *footnote_stencil = unsmob_stencil (footnote_stl); |
191 bool do_numbering = to_boolean (footnote->get_property ("automatic ally-numbered")); | 223 bool do_numbering = to_boolean (footnote->get_property ("automatic ally-numbered")); |
192 if (Spanner *orig = dynamic_cast<Spanner *>(footnote)) | 224 if (Spanner *orig = dynamic_cast<Spanner *>(footnote)) |
193 { | 225 { |
(...skipping 12 matching lines...) Expand all Loading... | |
206 for (vsize i = 0; i < orig->broken_intos_.size (); i++) | 238 for (vsize i = 0; i < orig->broken_intos_.size (); i++) |
207 orig->broken_intos_[i]->set_property ("text", annotati on_scm); | 239 orig->broken_intos_[i]->set_property ("text", annotati on_scm); |
208 } | 240 } |
209 | 241 |
210 Stencil *annotation = unsmob_stencil (scm_car (numbers)); | 242 Stencil *annotation = unsmob_stencil (scm_car (numbers)); |
211 annotation->translate_axis (footnote_stencil->extent (Y_AXIS)[ UP] + number_raise - annotation->extent (Y_AXIS)[UP], Y_AXIS); | 243 annotation->translate_axis (footnote_stencil->extent (Y_AXIS)[ UP] + number_raise - annotation->extent (Y_AXIS)[UP], Y_AXIS); |
212 footnote_stencil->add_at_edge (X_AXIS, LEFT, *annotation, 0.0) ; | 244 footnote_stencil->add_at_edge (X_AXIS, LEFT, *annotation, 0.0) ; |
213 numbers = scm_cdr (numbers); | 245 numbers = scm_cdr (numbers); |
214 in_text_numbers = scm_cdr (in_text_numbers); | 246 in_text_numbers = scm_cdr (in_text_numbers); |
215 } | 247 } |
216 mol.add_at_edge (Y_AXIS, DOWN, *footnote_stencil, padding); | 248 if (to_boolean (footnote->get_property ("footnote"))) |
249 mol.add_at_edge (Y_AXIS, DOWN, *footnote_stencil, padding); | |
250 else | |
251 in_note_mol.add_at_edge (Y_AXIS, DOWN, *footnote_stencil, paddin g); | |
Bertrand Bordage
2011/10/21 11:52:25
Check the line length.
| |
217 } | 252 } |
218 footnotes = scm_cons (mol.smobbed_copy (), footnotes); | 253 sys->set_property ("in-note-stencil", in_note_mol.smobbed_copy ()); |
254 sys->set_property ("footnote-stencil", mol.smobbed_copy ()); | |
219 } | 255 } |
220 // Take care of top-level markups | 256 // Take care of top-level markups |
221 else if (Prob *p = unsmob_prob (scm_car (s))) | 257 else if (Prob *p = unsmob_prob (scm_car (s))) |
222 { | 258 { |
223 SCM stencils = p->get_property ("footnotes"); | 259 SCM stencils = p->get_property ("footnotes"); |
224 if (stencils == SCM_EOL) | |
225 continue; | |
226 Stencil footnote_stencil; | 260 Stencil footnote_stencil; |
227 | 261 |
228 for (SCM st = stencils; scm_is_pair (st); st = scm_cdr (st)) | 262 for (SCM st = stencils; scm_is_pair (st); st = scm_cdr (st)) |
229 { | 263 { |
230 Stencil mol; | 264 Stencil mol; |
231 Stencil *footnote = unsmob_stencil (scm_caddar (st)); | 265 Stencil *footnote = unsmob_stencil (scm_caddar (st)); |
232 mol.add_stencil (*footnote); | 266 mol.add_stencil (*footnote); |
233 bool do_numbering = to_boolean (scm_cadar (st)); | 267 bool do_numbering = to_boolean (scm_cadar (st)); |
234 SCM in_text_stencil = Stencil ().smobbed_copy (); | 268 SCM in_text_stencil = Stencil ().smobbed_copy (); |
235 if (do_numbering) | 269 if (do_numbering) |
236 { | 270 { |
237 Stencil *annotation = unsmob_stencil (scm_car (numbers)); | 271 Stencil *annotation = unsmob_stencil (scm_car (numbers)); |
238 SCM in_text_annotation = scm_car (in_text_numbers); | 272 SCM in_text_annotation = scm_car (in_text_numbers); |
239 in_text_stencil = Text_interface::interpret_markup (layout, pr ops, in_text_annotation); | 273 in_text_stencil = Text_interface::interpret_markup (layout, pr ops, in_text_annotation); |
240 if (!unsmob_stencil (in_text_stencil)) | 274 if (!unsmob_stencil (in_text_stencil)) |
241 in_text_stencil = SCM_EOL; | 275 in_text_stencil = SCM_EOL; |
242 annotation->translate_axis (mol.extent (Y_AXIS)[UP] + number_r aise - annotation->extent (Y_AXIS)[UP], Y_AXIS); | 276 annotation->translate_axis (mol.extent (Y_AXIS)[UP] + number_r aise - annotation->extent (Y_AXIS)[UP], Y_AXIS); |
243 mol.add_at_edge (X_AXIS, LEFT, *annotation, 0.0); | 277 mol.add_at_edge (X_AXIS, LEFT, *annotation, 0.0); |
244 numbers = scm_cdr (numbers); | 278 numbers = scm_cdr (numbers); |
245 in_text_numbers = scm_cdr (in_text_numbers); | 279 in_text_numbers = scm_cdr (in_text_numbers); |
246 } | 280 } |
247 number_footnote_table = scm_cons (scm_cons (scm_caar (st), in_text _stencil), number_footnote_table); | 281 number_footnote_table = scm_cons (scm_cons (scm_caar (st), in_text _stencil), number_footnote_table); |
248 footnote_stencil.add_at_edge (Y_AXIS, DOWN, mol, padding); | 282 footnote_stencil.add_at_edge (Y_AXIS, DOWN, mol, padding); |
249 } | 283 } |
250 footnotes = scm_cons (footnote_stencil.smobbed_copy (), footnotes); | 284 p->set_property ("footnote-stencil", footnote_stencil.smobbed_copy ()) ; |
251 } | 285 } |
252 } | 286 } |
253 | 287 |
254 // note that this line of code doesn't do anything if numbering isn't turned o n | 288 // note that this line of code doesn't do anything if numbering isn't turned o n |
255 pb->top_paper ()->set_variable (ly_symbol2scm ("number-footnote-table"), numbe r_footnote_table); | 289 pb->top_paper ()->set_variable (ly_symbol2scm ("number-footnote-table"), numbe r_footnote_table); |
256 if (!scm_is_pair (footnotes)) | |
257 return SCM_EOL; | |
258 | |
259 return scm_reverse (footnotes); | |
260 } | 290 } |
261 | 291 |
262 Stencil * | 292 Stencil * |
263 Page_layout_problem::get_footnote_separator_stencil (Output_def *paper) | 293 Page_layout_problem::get_footnote_separator_stencil (Output_def *paper) |
264 { | 294 { |
265 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-page-properti es"), | 295 SCM props = scm_call_1 (ly_lily_module_constant ("layout-extract-page-properti es"), |
266 paper->self_scm ()); | 296 paper->self_scm ()); |
267 | 297 |
268 SCM markup = paper->c_variable ("footnote-separator-markup"); | 298 SCM markup = paper->c_variable ("footnote-separator-markup"); |
269 | 299 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 } | 336 } |
307 } | 337 } |
308 | 338 |
309 if (footnotes_found) | 339 if (footnotes_found) |
310 { | 340 { |
311 Stencil *separator = get_footnote_separator_stencil (pb->paper_); | 341 Stencil *separator = get_footnote_separator_stencil (pb->paper_); |
312 if (separator) | 342 if (separator) |
313 foot->add_at_edge (Y_AXIS, UP, *separator, footnote_padding); | 343 foot->add_at_edge (Y_AXIS, UP, *separator, footnote_padding); |
314 } | 344 } |
315 } | 345 } |
316 | 346 #include <valgrind/valgrind.h> |
Bertrand Bordage
2011/10/21 11:52:25
?
| |
317 Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst ems, int footnote_count) | 347 Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst ems) |
318 : bottom_skyline_ (DOWN) | 348 : bottom_skyline_ (DOWN) |
319 { | 349 {VALGRIND_PRINTF_BACKTRACE ("foo"); |
320 Prob *page = unsmob_prob (page_scm); | 350 Prob *page = unsmob_prob (page_scm); |
321 header_height_ = 0; | 351 header_height_ = 0; |
322 footer_height_ = 0; | 352 footer_height_ = 0; |
323 header_padding_ = 0; | 353 header_padding_ = 0; |
324 footer_padding_ = 0; | 354 footer_padding_ = 0; |
325 page_height_ = 100; | 355 page_height_ = 100; |
326 | 356 |
327 if (page) | 357 if (page) |
328 { | 358 { |
329 Stencil *head = unsmob_stencil (page->get_property ("head-stencil")); | 359 Stencil *head = unsmob_stencil (page->get_property ("head-stencil")); |
330 Stencil *foot = unsmob_stencil (page->get_property ("foot-stencil")); | 360 Stencil *foot = unsmob_stencil (page->get_property ("foot-stencil")); |
331 | 361 |
332 if (pb && pb->paper_) | 362 if (pb && pb->paper_) |
333 { | 363 { |
334 if (to_boolean (pb->paper_->c_variable ("reset-footnotes-on-new-page") )) | 364 SCM footnotes = get_footnotes_from_lines (systems); |
335 footnote_count = 0; | |
336 SCM footnotes = get_footnotes_from_lines (systems, footnote_count, pb) ; | |
337 add_footnotes_to_footer (footnotes, foot, pb); | 365 add_footnotes_to_footer (footnotes, foot, pb); |
338 } | 366 } |
339 else | 367 else |
340 warning ("A page layout problem has been initiated that cannot accommoda te footnotes."); | 368 warning ("A page layout problem has been initiated that cannot accommoda te footnotes."); |
341 | 369 |
342 header_height_ = head ? head->extent (Y_AXIS).length () : 0; | 370 header_height_ = head ? head->extent (Y_AXIS).length () : 0; |
343 footer_height_ = foot ? foot->extent (Y_AXIS).length () : 0; | 371 footer_height_ = foot ? foot->extent (Y_AXIS).length () : 0; |
344 page_height_ = robust_scm2double (page->get_property ("paper-height"), 100 ); | 372 page_height_ = robust_scm2double (page->get_property ("paper-height"), 100 ); |
345 } | 373 } |
346 | 374 |
(...skipping 28 matching lines...) Expand all Loading... | |
375 top_system_spacing = paper->c_variable ("top-markup-spacing"); | 403 top_system_spacing = paper->c_variable ("top-markup-spacing"); |
376 | 404 |
377 // Note: the page height here does _not_ reserve space for headers and | 405 // Note: the page height here does _not_ reserve space for headers and |
378 // footers. This is because we want to anchor the top-system-spacing | 406 // footers. This is because we want to anchor the top-system-spacing |
379 // spring at the _top_ of the header. | 407 // spring at the _top_ of the header. |
380 page_height_ -= robust_scm2double (paper->c_variable ("top-margin"), 0) | 408 page_height_ -= robust_scm2double (paper->c_variable ("top-margin"), 0) |
381 + robust_scm2double (paper->c_variable ("bottom-margin"), 0); | 409 + robust_scm2double (paper->c_variable ("bottom-margin"), 0); |
382 | 410 |
383 read_spacing_spec (top_system_spacing, &header_padding_, ly_symbol2scm ("p adding")); | 411 read_spacing_spec (top_system_spacing, &header_padding_, ly_symbol2scm ("p adding")); |
384 read_spacing_spec (last_bottom_spacing, &footer_padding_, ly_symbol2scm (" padding")); | 412 read_spacing_spec (last_bottom_spacing, &footer_padding_, ly_symbol2scm (" padding")); |
413 in_note_padding_ = robust_scm2double (paper->c_variable ("in-note-padding" ), 0.5); | |
Bertrand Bordage
2011/10/21 11:52:25
Line length.
| |
414 in_note_direction_ = to_dir (paper->c_variable ("in-note-direction")); | |
415 if (!in_note_direction_) | |
416 in_note_direction_ = UP; | |
Bertrand Bordage
2011/10/21 11:52:25
You could use robust_scm2dir instead of these thre
| |
385 } | 417 } |
386 bool last_system_was_title = false; | 418 bool last_system_was_title = false; |
387 | 419 |
388 for (SCM s = systems; scm_is_pair (s); s = scm_cdr (s)) | 420 for (SCM s = systems; scm_is_pair (s); s = scm_cdr (s)) |
389 { | 421 { |
390 bool first = (s == systems); | 422 bool first = (s == systems); |
391 | 423 |
392 if (Grob *g = unsmob_grob (scm_car (s))) | 424 if (Grob *g = unsmob_grob (scm_car (s))) |
393 { | 425 { |
394 System *sys = dynamic_cast<System *> (g); | 426 System *sys = dynamic_cast<System *> (g); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 extract_grob_set (align, "elements", all_elts); | 515 extract_grob_set (align, "elements", all_elts); |
484 vector<Grob *> elts = filter_dead_elements (all_elts); | 516 vector<Grob *> elts = filter_dead_elements (all_elts); |
485 vector<Real> minimum_offsets = Align_interface::get_minimum_translations_witho ut_min_dist (align, elts, Y_AXIS); | 517 vector<Real> minimum_offsets = Align_interface::get_minimum_translations_witho ut_min_dist (align, elts, Y_AXIS); |
486 vector<Real> minimum_offsets_with_min_dist = Align_interface::get_minimum_tran slations (align, elts, Y_AXIS); | 518 vector<Real> minimum_offsets_with_min_dist = Align_interface::get_minimum_tran slations (align, elts, Y_AXIS); |
487 | 519 |
488 Skyline up_skyline (UP); | 520 Skyline up_skyline (UP); |
489 Skyline down_skyline (DOWN); | 521 Skyline down_skyline (DOWN); |
490 build_system_skyline (elts, minimum_offsets_with_min_dist, &up_skyline, &down_ skyline); | 522 build_system_skyline (elts, minimum_offsets_with_min_dist, &up_skyline, &down_ skyline); |
491 up_skyline.shift (indent); | 523 up_skyline.shift (indent); |
492 down_skyline.shift (indent); | 524 down_skyline.shift (indent); |
525 Stencil *in_note_stencil = unsmob_stencil (sys->get_property ("in-note-stencil ")); | |
Bertrand Bordage
2011/10/21 11:52:25
Line length.
| |
526 | |
527 if (in_note_stencil && in_note_stencil->extent (Y_AXIS).length () > 0) | |
528 { | |
529 sys->set_property ("in-note-padding", scm_from_double (in_note_padding_)); | |
530 sys->set_property ("in-note-direction", scm_from_int (in_note_direction_)) ; | |
531 Skyline *sky = in_note_direction_ == UP ? &up_skyline : &down_skyline; | |
532 sky->set_minimum_height (sky->max_height () + in_note_direction_ * (in_not e_padding_ + in_note_stencil->extent (Y_AXIS).length ())); | |
Bertrand Bordage
2011/10/21 11:52:25
Line length.
| |
533 } | |
493 | 534 |
494 /* | 535 /* |
495 We need to call distance with skyline-horizontal-padding because | 536 We need to call distance with skyline-horizontal-padding because |
496 the system skyline-horizontal-padding is not added during the creation | 537 the system skyline-horizontal-padding is not added during the creation |
497 of an individual staff. So we add the padding for the distance check | 538 of an individual staff. So we add the padding for the distance check |
498 at the time of adding in the system. | 539 at the time of adding in the system. |
499 */ | 540 */ |
500 Real minimum_distance = up_skyline.distance (bottom_skyline_, robust_scm2doubl e (sys->get_property ("skyline-horizontal-padding"), 0)) + padding; | 541 Real minimum_distance = up_skyline.distance (bottom_skyline_, robust_scm2doubl e (sys->get_property ("skyline-horizontal-padding"), 0)) + padding; |
501 | 542 |
502 Spring spring_copy = spring; | 543 Spring spring_copy = spring; |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1093 { | 1134 { |
1094 if (Hara_kiri_group_spanner::has_interface (input[i])) | 1135 if (Hara_kiri_group_spanner::has_interface (input[i])) |
1095 Hara_kiri_group_spanner::consider_suicide (input[i]); | 1136 Hara_kiri_group_spanner::consider_suicide (input[i]); |
1096 | 1137 |
1097 if (input[i]->is_live ()) | 1138 if (input[i]->is_live ()) |
1098 output.push_back (input[i]); | 1139 output.push_back (input[i]); |
1099 } | 1140 } |
1100 | 1141 |
1101 return output; | 1142 return output; |
1102 } | 1143 } |
OLD | NEW |