http://codereview.appspot.com/6450113/diff/10001/lily/lookup.cc File lily/lookup.cc (right):
http://codereview.appspot.com/6450113/diff/10001/lily/lookup.cc#newcode172 lily/lookup.cc:172: if (b.x ().length () < blotdiameter) On 2012/09/03 07:25:53, Keith wrote:
It is arguably valid to request a box running from right to left, for
which
length() returns zero. In this application, the Interval class
abstraction is
not helping us. We could defeat the abstraction with if ( abs( b.x().delta() ) < blotdiameter) blotdiameter = abs( b.x().delta() );
Well, "arguably valid" does not mean that we can let some of our code argue one way, some of our code the other. If we argue it is invalid, we should deliver a programming error here in order to make people fix the callers. If we argue it is valid, the code needs to be able to deal with it. Both the code in this function as well as the code in any function it calls. Of course, this becomes easier to guarantee if the code in this function will, when in doubt, transform its input into a "proper" left-to-right box, giving the followup code better guarantees than those it contends itself to work with. http://codereview.appspot.com/6450113/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel