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) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl> |
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 396 |
397 Grob *me = (Grob *) this; | 397 Grob *me = (Grob *) this; |
398 | 398 |
399 SCM sym = axis_offset_symbol (a); | 399 SCM sym = axis_offset_symbol (a); |
400 me->dim_cache_[a].offset_ = new Real (0.0); | 400 me->dim_cache_[a].offset_ = new Real (0.0); |
401 | 401 |
402 /* | 402 /* |
403 UGH: can't fold next 2 statements together. Apparently GCC thinks | 403 UGH: can't fold next 2 statements together. Apparently GCC thinks |
404 dim_cache_[a].offset_ is unaliased. | 404 dim_cache_[a].offset_ is unaliased. |
405 */ | 405 */ |
406 Real off = robust_scm2double (internal_get_property (sym), 0.0); | 406 Real off = robust_scm2double (get_property (sym), 0.0); |
407 if (me->dim_cache_[a].offset_) | 407 if (me->dim_cache_[a].offset_) |
408 { | 408 { |
409 *me->dim_cache_[a].offset_ += off; | 409 *me->dim_cache_[a].offset_ += off; |
410 me->del_property (sym); | 410 me->del_property (sym); |
411 return *me->dim_cache_[a].offset_; | 411 return *me->dim_cache_[a].offset_; |
412 } | 412 } |
413 else | 413 else |
414 return 0.0; | 414 return 0.0; |
415 } | 415 } |
416 | 416 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 Interval real_ext; | 451 Interval real_ext; |
452 if (dim_cache_[a].extent_) | 452 if (dim_cache_[a].extent_) |
453 { | 453 { |
454 real_ext = *dim_cache_[a].extent_; | 454 real_ext = *dim_cache_[a].extent_; |
455 } | 455 } |
456 else | 456 else |
457 { | 457 { |
458 /* | 458 /* |
459 Order is significant: ?-extent may trigger suicide. | 459 Order is significant: ?-extent may trigger suicide. |
460 */ | 460 */ |
461 SCM ext_sym | 461 SCM ext = (a == X_AXIS) |
462 = (a == X_AXIS) | 462 ? get_property ("X-extent") |
463 ? ly_symbol2scm ("X-extent") | 463 : get_property ("Y-extent"); |
464 : ly_symbol2scm ("Y-extent"); | |
465 | |
466 SCM ext = internal_get_property (ext_sym); | |
467 if (is_number_pair (ext)) | 464 if (is_number_pair (ext)) |
468 real_ext.unite (ly_scm2interval (ext)); | 465 real_ext.unite (ly_scm2interval (ext)); |
469 | 466 |
470 SCM min_ext_sym | 467 SCM min_ext = (a == X_AXIS) |
471 = (a == X_AXIS) | 468 ? get_property ("minimum-X-extent") |
472 ? ly_symbol2scm ("minimum-X-extent") | 469 : get_property ("minimum-Y-extent"); |
473 : ly_symbol2scm ("minimum-Y-extent"); | |
474 SCM min_ext = internal_get_property (min_ext_sym); | |
475 if (is_number_pair (min_ext)) | 470 if (is_number_pair (min_ext)) |
476 real_ext.unite (ly_scm2interval (min_ext)); | 471 real_ext.unite (ly_scm2interval (min_ext)); |
477 | 472 |
478 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); | 473 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); |
479 } | 474 } |
480 | 475 |
481 // We never want nan, so we avoid shifting infinite values. | 476 // We never want nan, so we avoid shifting infinite values. |
482 if(!isinf (offset)) | 477 if(!isinf (offset)) |
483 real_ext.translate(offset); | 478 real_ext.translate(offset); |
484 else | 479 else |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 vector_sort (vec, direct_less); | 1001 vector_sort (vec, direct_less); |
1007 | 1002 |
1008 // Since the output is a sorted copy of the input with some elements | 1003 // Since the output is a sorted copy of the input with some elements |
1009 // removed, we can fill in the vector in-place if we do it starting | 1004 // removed, we can fill in the vector in-place if we do it starting |
1010 // from the front. | 1005 // from the front. |
1011 for (vsize i = 0; i < vec.size (); i++) | 1006 for (vsize i = 0; i < vec.size (); i++) |
1012 grobs[i] = *vec[i]; | 1007 grobs[i] = *vec[i]; |
1013 grobs.erase (grobs.begin () + vec.size (), grobs.end ()); | 1008 grobs.erase (grobs.begin () + vec.size (), grobs.end ()); |
1014 return; | 1009 return; |
1015 } | 1010 } |
OLD | NEW |