diff options
author | Neil Puttock <n.puttock@gmail.com> | 2010-10-30 16:08:01 +0100 |
---|---|---|
committer | Neil Puttock <n.puttock@gmail.com> | 2010-10-30 16:29:23 +0100 |
commit | 8af3c27f5b63009a9a8507fcfcc220a93dcbf725 (patch) | |
tree | 56d740ecba75a2e8de9804f96adf70d47f44c9af /lily/stencil-interpret.cc | |
parent | 14afb1ede443ad0ed187558424be2b78eaeeda41 (diff) |
Fix #888: Add ly:stencil-scale.
* input/regression/stencil-scale.ly
new regtest for testing ly:stencil-scale
* lily/stencil-interpret.cc (interpret_stencil_expression):
interpret new stencil command `scale-stencil', unscaling offset of body to
compensate for change in output scale
* lily/stencil-scheme.cc (ly_stencil_scale):
export new function `ly:stencil-scale'
* lily/stencil.cc, include/stencil.hh (scale):
new method for scaling stencils
* scm/define-markup-commands.scm (scale):
new markup command
* scm/define-stencil-commands.scm
(ly:all-stencil-commands): add stencil commands for setting and resetting
scale (`setscale', `resetscale')
(ly:all-output-backend-commands): add `scale-stencil' command
* scm/output-ps.scm, output-svg.scm (setscale, resetscale):
implement stencil outputters for scaling
Diffstat (limited to 'lily/stencil-interpret.cc')
-rw-r--r-- | lily/stencil-interpret.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lily/stencil-interpret.cc b/lily/stencil-interpret.cc index 509c89aba4..6985f2bbf0 100644 --- a/lily/stencil-interpret.cc +++ b/lily/stencil-interpret.cc @@ -88,6 +88,22 @@ interpret_stencil_expression (SCM expr, return; } + else if (head == ly_symbol2scm ("scale-stencil")) + { + SCM args = scm_cadr (expr); + SCM x_scale = scm_car (args); + SCM y_scale = scm_cadr (args); + Offset unscaled = o.scale (Offset (1 / scm_to_double (x_scale), + 1 / scm_to_double (y_scale))); + + (*func) (func_arg, scm_list_3 (ly_symbol2scm ("setscale"), x_scale, + y_scale)); + interpret_stencil_expression (scm_caddr (expr), func, func_arg, + unscaled); + (*func) (func_arg, scm_list_1 (ly_symbol2scm ("resetscale"))); + + return; + } else { (*func) (func_arg, |