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--2011 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2011 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 { | 238 { |
239 return dynamic_cast<Item *> (unsmob_grob (s)); | 239 return dynamic_cast<Item *> (unsmob_grob (s)); |
240 } | 240 } |
241 | 241 |
242 Interval | 242 Interval |
243 Item::pure_height (Grob *g, int start, int end) | 243 Item::pure_height (Grob *g, int start, int end) |
244 { | 244 { |
245 if (cached_pure_height_valid_) | 245 if (cached_pure_height_valid_) |
246 return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); | 246 return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); |
247 | 247 |
248 cached_pure_height_ = Grob::pure_height (this, start, end); | 248 cache_pure_height (Grob::pure_height (this, start, end)); |
| 249 return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); |
| 250 } |
| 251 |
| 252 void |
| 253 Item::cache_pure_height (Interval height) |
| 254 { |
| 255 cached_pure_height_ = height; |
249 cached_pure_height_valid_ = true; | 256 cached_pure_height_valid_ = true; |
250 return cached_pure_height_ + pure_relative_y_coordinate (g, start, end); | |
251 } | 257 } |
252 | 258 |
253 ADD_INTERFACE (Item, | 259 ADD_INTERFACE (Item, |
254 "Grobs can be distinguished in their role in the horizontal" | 260 "Grobs can be distinguished in their role in the horizontal" |
255 " spacing. Many grobs define constraints on the spacing by" | 261 " spacing. Many grobs define constraints on the spacing by" |
256 " their sizes, for example, note heads, clefs, stems, and all" | 262 " their sizes, for example, note heads, clefs, stems, and all" |
257 " other symbols with a fixed shape. These grobs form a" | 263 " other symbols with a fixed shape. These grobs form a" |
258 " subtype called @code{Item}.\n" | 264 " subtype called @code{Item}.\n" |
259 "\n" | 265 "\n" |
260 "Some items need special treatment for line breaking. For" | 266 "Some items need special treatment for line breaking. For" |
(...skipping 26 matching lines...) Expand all Loading... |
287 " end-of-line-invisible no yes yes\n" | 293 " end-of-line-invisible no yes yes\n" |
288 " center-invisible yes no yes\n" | 294 " center-invisible yes no yes\n" |
289 "@end example", | 295 "@end example", |
290 | 296 |
291 /* properties */ | 297 /* properties */ |
292 "break-visibility " | 298 "break-visibility " |
293 "extra-spacing-height " | 299 "extra-spacing-height " |
294 "extra-spacing-width " | 300 "extra-spacing-width " |
295 "non-musical " | 301 "non-musical " |
296 ); | 302 ); |
OLD | NEW |