David Kastrup wrote: > Personally, I am most uncomfortable with the "be relative > to current settings once" idea: that seems like a total > nightmare in situations using quotes or similar. The > question is where we could access a reasonably "default" > setting that relative references could be based on.
Okay, then I propose a completely new design, which will be a near total rewrite of the code, but it looks like it will be more elegant. Pardon the quasi-code. `\magnifyStaff mag' will do these overrides: for each shrinkable prop S, S = (* S (/ mag old-mag)) for each unshrinkable prop U, U = (if (< mag 1) (if (< old-mag 1) U (/ U old-mag)) (if (< old-mag 1) (* U mag)) (* U (/ mag old-mag))) \magnifyStaffRelative relative-mag = \magnifyStaff #(* old-mag relative-mag) \resetStaffSize = \magnifyStaff 1 The "default" setting, corresponding to size "1", will be equivalent to the size of the staff when magnifyStaff is first called. However, unlike before, the user won't be locked in to the initial "default". To change defaults mid-stream, the user would now be able to do: ... \magnifyStaff 0.75 ... \resetStaffSize [change defaults here] \magnifyStaff 0.75 ... Does this design look better? If you're curious and you want to try to understand the crux of the confusion in all of this, read below. ___________________________________________________________ Whether the mag value is interpreted as relative or absolute, magnifyStaff simply requires a consistent default size to refer to, if for no other reason than to prevent staff lines and the like from getting thinner than the default. It makes sense to me that, at least initially, the default size should be the size of the staff when magnifyStaff is first used. Note that \magnifyStaffRelative will *NOT* be precisely "relative to the current settings" every time, as demonstrated by the following example: ... % staff-space:1.00, staff-line:1.00 \magStaffRelative 0.75 % staff-space:0.75, staff-line:1.00 \magStaffRelative 2 % staff-space:1.50, staff-line:1.50 The call with value 0.75 won't scale staff lines below 1.00, because they're not supposed to get smaller than the "default". Accordingly, the call with value 2 won't scale everything relative to the current settings, because if it did then the staff lines would be too thick. If we allow the function to be consistently "relative to the current settings" each time, then we get staff lines that are too thin when reducing size. And if we say, "don't ever let staff lines reduce from the current size", then we get this: ... % staff-space:1.00, staff-line:1.00 \magStaffRelative 1.50 % staff-space:1.50, staff-line:1.50 \magStaffRelative 0.5 % staff-space:0.75, staff-line:1.50 Here, the staff lines, which should be back at 1.00, are stuck at 1.50: too thick. As I see it, the only way around this is to store some abstraction of an absolute "1" value, and to keep track of the relationship between the current staff size and that absolute value. Okay, hopefully I've stated the issue clearly. Sorry this is so confusing. I'm just trying to do it right. Let me know if you have more questions/concerns. Best, Mark _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel