LEFT | RIGHT |
(no file at all) | |
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) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1999--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 TODO: | 6 TODO: |
7 - add support for different stretch/shrink constants? | 7 - add support for different stretch/shrink constants? |
8 | 8 |
9 LilyPond is free software: you can redistribute it and/or modify | 9 LilyPond is free software: you can redistribute it and/or modify |
10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
11 the Free Software Foundation, either version 3 of the License, or | 11 the Free Software Foundation, either version 3 of the License, or |
12 (at your option) any later version. | 12 (at your option) any later version. |
13 | 13 |
14 LilyPond is distributed in the hope that it will be useful, | 14 LilyPond is distributed in the hope that it will be useful, |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 GNU General Public License for more details. | 17 GNU General Public License for more details. |
18 | 18 |
19 You should have received a copy of the GNU General Public License | 19 You should have received a copy of the GNU General Public License |
20 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. | 20 along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
21 */ | 21 */ |
22 | 22 #include <valgrind/valgrind.h> |
23 #include <cstdio> | 23 #include <cstdio> |
24 | 24 |
25 #include "column-x-positions.hh" | 25 #include "column-x-positions.hh" |
26 #include "dimensions.hh" | 26 #include "dimensions.hh" |
27 #include "international.hh" | 27 #include "international.hh" |
28 #include "libc-extension.hh" // isinf | 28 #include "libc-extension.hh" // isinf |
29 #include "paper-column.hh" | 29 #include "paper-column.hh" |
30 #include "simple-spacer.hh" | 30 #include "simple-spacer.hh" |
31 #include "spaceable-grob.hh" | 31 #include "spaceable-grob.hh" |
32 #include "spring.hh" | 32 #include "spring.hh" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 { | 155 { |
156 Real l = 0.; | 156 Real l = 0.; |
157 for (vsize i = 0; i < springs_.size (); i++) | 157 for (vsize i = 0; i < springs_.size (); i++) |
158 l += springs_[i].length (force); | 158 l += springs_[i].length (force); |
159 | 159 |
160 return l; | 160 return l; |
161 } | 161 } |
162 | 162 |
163 void | 163 void |
164 Simple_spacer::solve (Real line_len, bool ragged) | 164 Simple_spacer::solve (Real line_len, bool ragged) |
165 { | 165 {VALGRIND_PRINTF_BACKTRACE ("FOO"); |
166 Real conf = configuration_length (force_); | 166 Real conf = configuration_length (force_); |
167 | 167 |
168 ragged_ = ragged; | 168 ragged_ = ragged; |
169 line_len_ = line_len; | 169 line_len_ = line_len; |
170 if (conf < line_len_) | 170 if (conf < line_len_) |
171 force_ = expand_line (); | 171 force_ = expand_line (); |
172 else if (conf > line_len_) | 172 else if (conf > line_len_) |
173 force_ = compress_line (); | 173 force_ = compress_line (); |
174 | 174 |
175 if (ragged && force_ < 0) | 175 if (ragged && force_ < 0) |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 for (vsize i = 1; i + 1 < ret.cols_.size (); i++) | 517 for (vsize i = 1; i + 1 < ret.cols_.size (); i++) |
518 { | 518 { |
519 SCM p = ret.cols_[i]->get_property ("line-break-permission"); | 519 SCM p = ret.cols_[i]->get_property ("line-break-permission"); |
520 if (p == ly_symbol2scm ("force")) | 520 if (p == ly_symbol2scm ("force")) |
521 ret.satisfies_constraints_ = false; | 521 ret.satisfies_constraints_ = false; |
522 } | 522 } |
523 | 523 |
524 return ret; | 524 return ret; |
525 } | 525 } |
526 | 526 |
LEFT | RIGHT |