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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 { | 72 { |
73 for (SCM s = scm_cdr (object_cbs); scm_is_pair (s); s = scm_cdr (s)) | 73 for (SCM s = scm_cdr (object_cbs); scm_is_pair (s); s = scm_cdr (s)) |
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) |
| 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); |
82 } | 86 } |
83 | 87 |
84 Grob::Grob (Grob const &s) | 88 Grob::Grob (Grob const &s) |
85 : dim_cache_ (s.dim_cache_) | 89 : dim_cache_ (s.dim_cache_) |
86 { | 90 { |
87 original_ = (Grob *) & s; | 91 original_ = (Grob *) & s; |
88 self_scm_ = SCM_EOL; | 92 self_scm_ = SCM_EOL; |
89 | 93 |
90 immutable_property_alist_ = s.immutable_property_alist_; | 94 immutable_property_alist_ = s.immutable_property_alist_; |
91 mutable_property_alist_ = SCM_EOL; | 95 mutable_property_alist_ = SCM_EOL; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 = (a == X_AXIS) | 463 = (a == X_AXIS) |
460 ? ly_symbol2scm ("minimum-X-extent") | 464 ? ly_symbol2scm ("minimum-X-extent") |
461 : ly_symbol2scm ("minimum-Y-extent"); | 465 : ly_symbol2scm ("minimum-Y-extent"); |
462 SCM min_ext = internal_get_property (min_ext_sym); | 466 SCM min_ext = internal_get_property (min_ext_sym); |
463 if (is_number_pair (min_ext)) | 467 if (is_number_pair (min_ext)) |
464 real_ext.unite (ly_scm2interval (min_ext)); | 468 real_ext.unite (ly_scm2interval (min_ext)); |
465 | 469 |
466 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); | 470 ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext); |
467 } | 471 } |
468 | 472 |
469 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; |
470 | 477 |
471 return real_ext; | 478 return real_ext; |
472 } | 479 } |
473 | 480 |
474 Interval | 481 Interval |
475 Grob::pure_height (Grob *refp, int start, int end) | 482 Grob::pure_height (Grob *refp, int start, int end) |
476 { | 483 { |
477 SCM iv_scm = get_pure_property ("Y-extent", start, end); | 484 SCM iv_scm = get_pure_property ("Y-extent", start, end); |
478 Interval iv = robust_scm2interval (iv_scm, Interval (0, 0)); | 485 Interval iv = robust_scm2interval (iv_scm, Interval (0, 0)); |
479 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... |
792 "axis-group-parent-X " | 799 "axis-group-parent-X " |
793 "axis-group-parent-Y " | 800 "axis-group-parent-Y " |
794 "before-line-breaking " | 801 "before-line-breaking " |
795 "cause " | 802 "cause " |
796 "color " | 803 "color " |
797 "cross-staff " | 804 "cross-staff " |
798 "id " | 805 "id " |
799 "extra-X-extent " | 806 "extra-X-extent " |
800 "extra-Y-extent " | 807 "extra-Y-extent " |
801 "extra-offset " | 808 "extra-offset " |
| 809 "footnote-music " |
802 "forced-spacing " | 810 "forced-spacing " |
| 811 "horizontal-skylines " |
803 "interfaces " | 812 "interfaces " |
804 "layer " | 813 "layer " |
805 "meta " | 814 "meta " |
806 "minimum-X-extent " | 815 "minimum-X-extent " |
807 "minimum-Y-extent " | 816 "minimum-Y-extent " |
808 "outside-staff-horizontal-padding " | 817 "outside-staff-horizontal-padding " |
809 "outside-staff-padding " | 818 "outside-staff-padding " |
810 "outside-staff-priority " | 819 "outside-staff-priority " |
811 "pure-Y-offset-in-progress " | 820 "pure-Y-offset-in-progress " |
812 "rotation " | 821 "rotation " |
| 822 "skyline-horizontal-padding " |
813 "springs-and-rods " | 823 "springs-and-rods " |
814 "staff-symbol " | 824 "staff-symbol " |
815 "stencil " | 825 "stencil " |
816 "transparent " | 826 "transparent " |
817 "vertical-skylines " | 827 "vertical-skylines " |
818 "whiteout " | 828 "whiteout " |
819 ); | 829 ); |
820 | 830 |
821 /**************************************************************** | 831 /**************************************************************** |
822 CALLBACKS | 832 CALLBACKS |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 if (Align_interface::has_interface (commony)) | 928 if (Align_interface::has_interface (commony)) |
919 return true; | 929 return true; |
920 | 930 |
921 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)) |
922 if (Align_interface::has_interface (g)) | 932 if (Align_interface::has_interface (g)) |
923 return true; | 933 return true; |
924 | 934 |
925 return false; | 935 return false; |
926 } | 936 } |
927 | 937 |
LEFT | RIGHT |