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) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2012 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 set_object (scm_caar (s), scm_cdar (s)); | 74 set_object (scm_caar (s), scm_cdar (s)); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 if (get_property_data ("X-extent") == SCM_EOL) | 78 if (get_property_data ("X-extent") == SCM_EOL) |
79 set_property ("X-extent", Grob::stencil_width_proc); | 79 set_property ("X-extent", Grob::stencil_width_proc); |
80 if (get_property_data ("Y-extent") == SCM_EOL) | 80 if (get_property_data ("Y-extent") == SCM_EOL) |
81 set_property ("Y-extent", Grob::stencil_height_proc); | 81 set_property ("Y-extent", Grob::stencil_height_proc); |
82 if (get_property_data ("vertical-skylines") == SCM_EOL) | 82 if (get_property_data ("vertical-skylines") == SCM_EOL) |
83 set_property ("vertical-skylines", Grob::simple_vertical_skylines_from_stenc
il_proc); | 83 set_property ("vertical-skylines", Grob::simple_vertical_skylines_from_stenc
il_proc); |
| 84 if (get_property_data ("horizontal-skylines") == SCM_EOL) |
| 85 set_property ("horizontal-skylines", Grob::simple_horizontal_skylines_from_s
tencil_proc); |
84 } | 86 } |
85 | 87 |
86 Grob::Grob (Grob const &s) | 88 Grob::Grob (Grob const &s) |
87 : dim_cache_ (s.dim_cache_) | 89 : dim_cache_ (s.dim_cache_) |
88 { | 90 { |
89 original_ = (Grob *) & s; | 91 original_ = (Grob *) & s; |
90 self_scm_ = SCM_EOL; | 92 self_scm_ = SCM_EOL; |
91 | 93 |
92 immutable_property_alist_ = s.immutable_property_alist_; | 94 immutable_property_alist_ = s.immutable_property_alist_; |
93 mutable_property_alist_ = SCM_EOL; | 95 mutable_property_alist_ = SCM_EOL; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 = (a == X_AXIS) | 463 = (a == X_AXIS) |
462 ? ly_symbol2scm ("minimum-X-extent") | 464 ? ly_symbol2scm ("minimum-X-extent") |
463 : ly_symbol2scm ("minimum-Y-extent"); | 465 : ly_symbol2scm ("minimum-Y-extent"); |
464 SCM min_ext = internal_get_property (min_ext_sym); | 466 SCM min_ext = internal_get_property (min_ext_sym); |
465 if (is_number_pair (min_ext)) | 467 if (is_number_pair (min_ext)) |
466 real_ext.unite (ly_scm2interval (min_ext)); | 468 real_ext.unite (ly_scm2interval (min_ext)); |
467 | 469 |
468 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); | 470 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); |
469 } | 471 } |
470 | 472 |
471 real_ext.translate (offset); | 473 // We never want nan, so we avoid shifting infinite values. |
| 474 for (LEFT_and_RIGHT (d)) |
| 475 if (!isinf (real_ext[d])) |
| 476 real_ext[d] += offset; |
472 | 477 |
473 return real_ext; | 478 return real_ext; |
474 } | 479 } |
475 | 480 |
476 Interval | 481 Interval |
477 Grob::pure_height (Grob *refp, int start, int end) | 482 Grob::pure_height (Grob *refp, int start, int end) |
478 { | 483 { |
479 SCM iv_scm = get_pure_property ("Y-extent", start, end); | 484 SCM iv_scm = get_pure_property ("Y-extent", start, end); |
480 Interval iv = robust_scm2interval (iv_scm, Interval (0, 0)); | 485 Interval iv = robust_scm2interval (iv_scm, Interval (0, 0)); |
481 Real offset = pure_relative_y_coordinate (refp, start, end); | 486 Real offset = pure_relative_y_coordinate (refp, start, end); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 "axis-group-parent-X " | 799 "axis-group-parent-X " |
795 "axis-group-parent-Y " | 800 "axis-group-parent-Y " |
796 "before-line-breaking " | 801 "before-line-breaking " |
797 "cause " | 802 "cause " |
798 "color " | 803 "color " |
799 "cross-staff " | 804 "cross-staff " |
800 "id " | 805 "id " |
801 "extra-X-extent " | 806 "extra-X-extent " |
802 "extra-Y-extent " | 807 "extra-Y-extent " |
803 "extra-offset " | 808 "extra-offset " |
| 809 "footnote-music " |
804 "forced-spacing " | 810 "forced-spacing " |
| 811 "horizontal-skylines " |
805 "interfaces " | 812 "interfaces " |
806 "layer " | 813 "layer " |
807 "meta " | 814 "meta " |
808 "minimum-X-extent " | 815 "minimum-X-extent " |
809 "minimum-Y-extent " | 816 "minimum-Y-extent " |
810 "outside-staff-horizontal-padding " | 817 "outside-staff-horizontal-padding " |
811 "outside-staff-padding " | 818 "outside-staff-padding " |
812 "outside-staff-priority " | 819 "outside-staff-priority " |
813 "pure-Y-offset-in-progress " | 820 "pure-Y-offset-in-progress " |
814 "rotation " | 821 "rotation " |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 if (Align_interface::has_interface (commony)) | 928 if (Align_interface::has_interface (commony)) |
922 return true; | 929 return true; |
923 | 930 |
924 for (Grob *g = this; g && g != commony; g = g->get_parent (Y_AXIS)) | 931 for (Grob *g = this; g && g != commony; g = g->get_parent (Y_AXIS)) |
925 if (Align_interface::has_interface (g)) | 932 if (Align_interface::has_interface (g)) |
926 return true; | 933 return true; |
927 | 934 |
928 return false; | 935 return false; |
929 } | 936 } |
930 | 937 |
LEFT | RIGHT |