X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspacing-options.cc;h=dbf0587acdd7e6e98ae9110516d07a7b8cee222d;hb=4d405ef96a8a62771d7d9a283ff5369a772e89d8;hp=8719e4cc6b067f21218b512e59a4e3966c92f787;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/lily/spacing-options.cc b/lily/spacing-options.cc index 8719e4cc6b..dbf0587acd 100644 --- a/lily/spacing-options.cc +++ b/lily/spacing-options.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2011 Han-Wen Nienhuys + Copyright (C) 2006--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify @@ -66,9 +66,9 @@ Spacing_options::Spacing_options () Real Spacing_options::get_duration_space (Rational d) const { - Real k = shortest_duration_space_; + Real ratio = d / global_shortest_; - if (d < global_shortest_) + if (ratio < 1.0) { /* We don't space really short notes using the log of the @@ -86,9 +86,8 @@ Spacing_options::get_duration_space (Rational d) const */ - Rational ratio = d / global_shortest_; - return ((k - 1) + double (ratio)) * increment_; + return (shortest_duration_space_ + ratio - 1) * increment_; } else { @@ -97,10 +96,8 @@ Spacing_options::get_duration_space (Rational d) const Report OSU-CISRC-10/87-TR35, Department of Computer and Information Science, The Ohio State University, 1987. */ - Real log = log_2 (global_shortest_); - k -= log; - return (log_2 (d) + k) * increment_; + return (shortest_duration_space_ + log_2 (ratio)) * increment_; } }