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--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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 /* | 43 /* |
44 For raggedright without ragged staves, simply set width to the linewidth. | 44 For raggedright without ragged staves, simply set width to the linewidth. |
45 | 45 |
46 (ok -- lousy UI, since width is in staff spaces) | 46 (ok -- lousy UI, since width is in staff spaces) |
47 | 47 |
48 --hwn. | 48 --hwn. |
49 */ | 49 */ |
50 Real t = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); | 50 Real t = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); |
51 t *= robust_scm2double (me->get_property ("thickness"), 1.0); | 51 t *= robust_scm2double (me->get_property ("thickness"), 1.0); |
52 | 52 |
53 Direction d = LEFT; | 53 for (LEFT_and_RIGHT (d)) |
54 do | |
55 { | 54 { |
56 SCM width_scm = me->get_property ("width"); | 55 SCM width_scm = me->get_property ("width"); |
57 if (d == RIGHT && scm_is_number (width_scm)) | 56 if (d == RIGHT && scm_is_number (width_scm)) |
58 { | 57 { |
59 /* | 58 /* |
60 don't multiply by Staff_symbol_referencer::staff_space (me), | 59 don't multiply by Staff_symbol_referencer::staff_space (me), |
61 since that would make aligning staff symbols of different sizes to | 60 since that would make aligning staff symbols of different sizes to |
62 one right margin hell. | 61 one right margin hell. |
63 */ | 62 */ |
64 span_points[RIGHT] = scm_to_double (width_scm); | 63 span_points[RIGHT] = scm_to_double (width_scm); |
65 } | 64 } |
66 else | 65 else |
67 { | 66 { |
68 Item *x = sp->get_bound (d); | 67 Item *x = sp->get_bound (d); |
69 | 68 |
70 span_points[d] = ((!x->break_status_dir () | 69 span_points[d] = ((!x->break_status_dir () |
71 && !x->extent (x, X_AXIS).is_empty ()) | 70 && !x->extent (x, X_AXIS).is_empty ()) |
72 ? Paper_column::break_align_width (x, ly_symbol2scm
("break-alignment"))[d] | 71 ? Paper_column::break_align_width (x, ly_symbol2scm
("break-alignment"))[d] |
73 : x->relative_coordinate (common, X_AXIS)); | 72 : x->relative_coordinate (common, X_AXIS)); |
74 } | 73 } |
75 | 74 |
76 span_points[d] -= d * t / 2; | 75 span_points[d] -= d * t / 2; |
77 } | 76 } |
78 while (flip (&d) != LEFT); | |
79 | 77 |
80 Stencil m; | 78 Stencil m; |
81 | 79 |
82 vector<Real> line_positions = Staff_symbol::line_positions (me); | 80 vector<Real> line_positions = Staff_symbol::line_positions (me); |
83 | 81 |
84 Stencil line | 82 Stencil line |
85 = Lookup::horizontal_line (span_points | 83 = Lookup::horizontal_line (span_points |
86 - me->relative_coordinate (common, X_AXIS), | 84 - me->relative_coordinate (common, X_AXIS), |
87 t); | 85 t); |
88 | 86 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 /* properties */ | 374 /* properties */ |
377 "ledger-extra " | 375 "ledger-extra " |
378 "ledger-line-thickness " | 376 "ledger-line-thickness " |
379 "ledger-positions " | 377 "ledger-positions " |
380 "line-count " | 378 "line-count " |
381 "line-positions " | 379 "line-positions " |
382 "staff-space " | 380 "staff-space " |
383 "thickness " | 381 "thickness " |
384 "width " | 382 "width " |
385 ); | 383 ); |
OLD | NEW |