Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(820)

Side by Side Diff: lily/page-breaking.cc

Issue 2303044: Rename vertical spacing dimensions. (Closed)
Patch Set: Update convertrules, regtests, and English docs. Created 14 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
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) 2006--2010 Joe Neeman <joeneeman@gmail.com> 4 Copyright (C) 2006--2010 Joe Neeman <joeneeman@gmail.com>
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 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 } 1446 }
1447 1447
1448 // This gives the minimum distance between the top of the 1448 // This gives the minimum distance between the top of the
1449 // printable area (ie. the bottom of the top-margin) and 1449 // printable area (ie. the bottom of the top-margin) and
1450 // the extent box of the topmost system. 1450 // the extent box of the topmost system.
1451 Real 1451 Real
1452 Page_breaking::min_whitespace_at_top_of_page (Line_details const &line) const 1452 Page_breaking::min_whitespace_at_top_of_page (Line_details const &line) const
1453 { 1453 {
1454 SCM first_system_spacing = book_->paper_->c_variable ("top-system-spacing"); 1454 SCM first_system_spacing = book_->paper_->c_variable ("top-system-spacing");
1455 if (line.title_) 1455 if (line.title_)
1456 first_system_spacing = book_->paper_->c_variable ("top-title-spacing"); 1456 first_system_spacing = book_->paper_->c_variable ("top-markup-spacing");
1457 1457
1458 Real min_distance = -infinity_f; 1458 Real min_distance = -infinity_f;
1459 Real padding = 0; 1459 Real padding = 0;
1460 1460
1461 Page_layout_problem::read_spacing_spec (first_system_spacing, 1461 Page_layout_problem::read_spacing_spec (first_system_spacing,
1462 &min_distance, 1462 &min_distance,
1463 ly_symbol2scm ("minimum-distance")); 1463 ly_symbol2scm ("minimum-distance"));
1464 Page_layout_problem::read_spacing_spec (first_system_spacing, 1464 Page_layout_problem::read_spacing_spec (first_system_spacing,
1465 &padding, 1465 &padding,
1466 ly_symbol2scm ("padding")); 1466 ly_symbol2scm ("padding"));
1467 1467
1468 // FIXME: take into account the height of the header 1468 // FIXME: take into account the height of the header
1469 Real translate = max (line.shape_.begin_[UP], line.shape_.rest_[UP]); 1469 Real translate = max (line.shape_.begin_[UP], line.shape_.rest_[UP]);
1470 return max (0.0, max (padding, min_distance - translate)); 1470 return max (0.0, max (padding, min_distance - translate));
1471 } 1471 }
1472 1472
1473 Real 1473 Real
1474 Page_breaking::min_whitespace_at_bottom_of_page (Line_details const &line) const 1474 Page_breaking::min_whitespace_at_bottom_of_page (Line_details const &line) const
1475 { 1475 {
1476 SCM last_system_spacing = book_->paper_->c_variable ("bottom-system-spacing"); 1476 SCM last_system_spacing = book_->paper_->c_variable ("system-bottom-spacing");
1477 Real min_distance = -infinity_f; 1477 Real min_distance = -infinity_f;
1478 Real padding = 0; 1478 Real padding = 0;
1479 1479
1480 Page_layout_problem::read_spacing_spec (last_system_spacing, 1480 Page_layout_problem::read_spacing_spec (last_system_spacing,
1481 &min_distance, 1481 &min_distance,
1482 ly_symbol2scm ("minimum-distance")); 1482 ly_symbol2scm ("minimum-distance"));
1483 Page_layout_problem::read_spacing_spec (last_system_spacing, 1483 Page_layout_problem::read_spacing_spec (last_system_spacing,
1484 &padding, 1484 &padding,
1485 ly_symbol2scm ("padding")); 1485 ly_symbol2scm ("padding"));
1486 1486
1487 // FIXME: take into account the height of the footer 1487 // FIXME: take into account the height of the footer
1488 Real translate = min (line.shape_.begin_[DOWN], line.shape_.rest_[DOWN]); 1488 Real translate = min (line.shape_.begin_[DOWN], line.shape_.rest_[DOWN]);
1489 return max (0.0, max (padding, min_distance + translate)); 1489 return max (0.0, max (padding, min_distance + translate));
1490 } 1490 }
1491 1491
1492 int 1492 int
1493 Page_breaking::orphan_penalty () const 1493 Page_breaking::orphan_penalty () const
1494 { 1494 {
1495 return orphan_penalty_; 1495 return orphan_penalty_;
1496 } 1496 }
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b