]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stencil-interpret.cc
Change the behavior of nested StaffGroupers.
[lilypond.git] / lily / stencil-interpret.cc
index fb749db3023617d6801d1b5737f62b970f28000d..19c241ea849fa8f09f591e9e30ec9219746e2595 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -86,6 +86,22 @@ interpret_stencil_expression (SCM expr,
          interpret_stencil_expression (scm_caddr (expr), func, func_arg, o);
          (*func) (func_arg, scm_list_4 (ly_symbol2scm ("resetrotation"), angle, x, y));
 
+         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