LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv), | 283 return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv), |
284 scm_to_double (t), | 284 scm_to_double (t), |
285 scm_to_double (p), | 285 scm_to_double (p), |
286 0.95 * scm_to_double (t)).smobbed_copy (); | 286 0.95 * scm_to_double (t)).smobbed_copy (); |
287 } | 287 } |
288 | 288 |
289 LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate", | 289 LY_DEFINE (ly_stencil_rotate, "ly:stencil-rotate", |
290 4, 0, 0, (SCM stil, SCM angle, SCM x, SCM y), | 290 4, 0, 0, (SCM stil, SCM angle, SCM x, SCM y), |
291 "Return a stencil @var{stil} rotated @var{angle} degrees around" | 291 "Return a stencil @var{stil} rotated @var{angle} degrees around" |
292 " the relative offset (@var{x}, @var{y}). E.g. an offset of" | 292 " the relative offset (@var{x}, @var{y}). E.g., an offset of" |
293 " (-1, 1) will rotate the stencil around the left upper corner.") | 293 " (-1, 1) will rotate the stencil around the left upper corner.") |
294 { | 294 { |
295 Stencil *s = unsmob_stencil (stil); | 295 Stencil *s = unsmob_stencil (stil); |
296 LY_ASSERT_SMOB (Stencil, stil, 1); | 296 LY_ASSERT_SMOB (Stencil, stil, 1); |
297 LY_ASSERT_TYPE (scm_is_number, angle, 2); | 297 LY_ASSERT_TYPE (scm_is_number, angle, 2); |
298 LY_ASSERT_TYPE (scm_is_number, x, 3); | 298 LY_ASSERT_TYPE (scm_is_number, x, 3); |
299 LY_ASSERT_TYPE (scm_is_number, y, 4); | 299 LY_ASSERT_TYPE (scm_is_number, y, 4); |
300 Real a = scm_to_double (angle); | 300 Real a = scm_to_double (angle); |
301 Real x_off = scm_to_double (x); | 301 Real x_off = scm_to_double (x); |
302 Real y_off = scm_to_double (y); | 302 Real y_off = scm_to_double (y); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 LY_ASSERT_SMOB (Stencil, stil, 1); | 393 LY_ASSERT_SMOB (Stencil, stil, 1); |
394 LY_ASSERT_TYPE (scm_is_number, x, 2); | 394 LY_ASSERT_TYPE (scm_is_number, x, 2); |
395 LY_ASSERT_TYPE (scm_is_number, y, 3); | 395 LY_ASSERT_TYPE (scm_is_number, y, 3); |
396 | 396 |
397 SCM new_s = s->smobbed_copy (); | 397 SCM new_s = s->smobbed_copy (); |
398 Stencil *q = unsmob_stencil (new_s); | 398 Stencil *q = unsmob_stencil (new_s); |
399 | 399 |
400 q->scale (scm_to_double (x), scm_to_double (y)); | 400 q->scale (scm_to_double (x), scm_to_double (y)); |
401 return new_s; | 401 return new_s; |
402 } | 402 } |
LEFT | RIGHT |