lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implement make-bow-stencil, make-tie-stencil for use in markup-comma


From: dak
Subject: Re: Implement make-bow-stencil, make-tie-stencil for use in markup-commands undertie and overtie (issue 270640043 by address@hidden)
Date: Tue, 10 Nov 2015 20:52:18 +0000


https://codereview.appspot.com/270640043/diff/40001/scm/stencil.scm
File scm/stencil.scm (right):

https://codereview.appspot.com/270640043/diff/40001/scm/stencil.scm#newcode73
scm/stencil.scm:73: (width (- (car stop) (car start)))
I'd not use `width' (and `height') here but `dx' and `dy': the
expectation for variable names `width' and `height' is that they will
generally be non-negative.

https://codereview.appspot.com/270640043/diff/40001/scm/stencil.scm#newcode81
scm/stencil.scm:81: ;;;;     beginning '(0 . 0), ending at (cons
length-to-print 0)
Ah, here's the rub.  Why end at (length-to-print . 0) instead of (1 .
0)?  Scaling by length at the start instead of after you are done makes
things unnecessarily complex and indeed requires Pythagoras.  If you
instead work with a "unit" bow, scaling and rotating the resulting
points to match some actual line does not require calculating the line
length but just the equivalent of a complex multiplication in cartesian
coordinates.

https://codereview.appspot.com/270640043/diff/40001/scm/stencil.scm#newcode123
scm/stencil.scm:123: length-to-print)
See?  You've effectively multiplied everything with length-to-print at
the start, just to divide by it again here.

Total waste of effort.

https://codereview.appspot.com/270640043/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]