Left: | ||
Right: |
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) 2012--2020 Mike Solomon <mike@mikesolomon.org> | 4 Copyright (C) 2012--2020 Mike Solomon <mike@mikesolomon.org> |
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 /* draw straight lines */ | 227 /* draw straight lines */ |
228 Offset points[] = { | 228 Offset points[] = { |
229 Offset (-left, -bottom + radius), Offset (-left, top - radius), | 229 Offset (-left, -bottom + radius), Offset (-left, top - radius), |
230 Offset (-left + radius, top), Offset (right - radius, top), | 230 Offset (-left + radius, top), Offset (right - radius, top), |
231 Offset (right, top - radius), Offset (right, -bottom + radius), | 231 Offset (right, top - radius), Offset (right, -bottom + radius), |
232 Offset (right - radius, -bottom), Offset (-left + radius, -bottom), | 232 Offset (right - radius, -bottom), Offset (-left + radius, -bottom), |
233 }; | 233 }; |
234 for (vsize i = 0; i < ARRAYSIZE (points); i += 2) | 234 for (vsize i = 0; i < ARRAYSIZE (points); i += 2) |
235 { | 235 { |
236 skyline->add_contour_segment (transform, CW, points[i], | 236 skyline->add_contour_segment (transform, CW, points[i], |
237 points[i + 1]); | 237 points[i + 1]); |
hahnjo
2020/05/08 08:15:59
AFAICS this is switching from CCW to CW - is there
hanwenn
2020/05/08 14:03:23
the previous code didn't have an ordering, afaict.
| |
238 } | 238 } |
239 | 239 |
240 /* draw rounded corners */ | 240 /* draw rounded corners */ |
241 if (radius) | 241 if (radius) |
242 { | 242 { |
243 Offset rad (radius, 0); | 243 Offset rad (radius, 0); |
244 Drul_array<Real> cx; | 244 Drul_array<Real> cx; |
245 Drul_array<Real> cy; | 245 Drul_array<Real> cy; |
246 | 246 |
247 cx[LEFT] = -left + radius; | 247 cx[LEFT] = -left + radius; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 Transform local = transform; | 689 Transform local = transform; |
690 local.rotate (ang, center); | 690 local.rotate (ang, center); |
691 interpret_stencil_for_skyline (skyline, local, scm_caddr (expr)); | 691 interpret_stencil_for_skyline (skyline, local, scm_caddr (expr)); |
692 } | 692 } |
693 else if (scm_is_eq (head, ly_symbol2scm ("grob-cause"))) | 693 else if (scm_is_eq (head, ly_symbol2scm ("grob-cause"))) |
694 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); | 694 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); |
695 else if (scm_is_eq (head, ly_symbol2scm ("color"))) | 695 else if (scm_is_eq (head, ly_symbol2scm ("color"))) |
696 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); | 696 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); |
697 else if (scm_is_eq (head, ly_symbol2scm ("output-attributes"))) | 697 else if (scm_is_eq (head, ly_symbol2scm ("output-attributes"))) |
698 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); | 698 interpret_stencil_for_skyline (skyline, transform, scm_caddr (expr)); |
699 else if (scm_is_eq (head, ly_symbol2scm ("utf-8-string"))) | |
700 { | |
701 // 4th element, strip the (quote ..) | |
702 SCM orig = scm_cadar (scm_cdddr (expr)); | |
703 interpret_stencil_for_skyline (skyline, transform, orig); | |
704 } | |
699 else if (scm_is_eq (head, ly_symbol2scm ("with-outline"))) | 705 else if (scm_is_eq (head, ly_symbol2scm ("with-outline"))) |
700 interpret_stencil_for_skyline (skyline, transform, scm_cadr (expr)); | 706 interpret_stencil_for_skyline (skyline, transform, scm_cadr (expr)); |
701 else if (scm_is_eq (head, ly_symbol2scm ("draw-line"))) | 707 else if (scm_is_eq (head, ly_symbol2scm ("draw-line"))) |
702 make_draw_line_boxes (skyline, transform, scm_cdr (expr)); | 708 make_draw_line_boxes (skyline, transform, scm_cdr (expr)); |
703 else if (scm_is_eq (head, ly_symbol2scm ("dashed-line"))) | 709 else if (scm_is_eq (head, ly_symbol2scm ("dashed-line"))) |
704 { | 710 { |
705 expr = scm_cdr (expr); | 711 expr = scm_cdr (expr); |
706 SCM th = scm_car (expr); | 712 SCM th = scm_car (expr); |
707 expr = scm_cdr (expr); | 713 expr = scm_cdr (expr); |
708 expr = scm_cdr (expr); // on | 714 expr = scm_cdr (expr); // on |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
948 | 954 |
949 MAKE_SCHEME_CALLBACK (Grob, pure_horizontal_skylines_from_element_stencils, 3); | 955 MAKE_SCHEME_CALLBACK (Grob, pure_horizontal_skylines_from_element_stencils, 3); |
950 SCM | 956 SCM |
951 Grob::pure_horizontal_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm) | 957 Grob::pure_horizontal_skylines_from_element_stencils (SCM smob, SCM beg_scm, SCM end_scm) |
952 { | 958 { |
953 Grob *me = unsmob<Grob> (smob); | 959 Grob *me = unsmob<Grob> (smob); |
954 int beg = robust_scm2int (beg_scm, 0); | 960 int beg = robust_scm2int (beg_scm, 0); |
955 int end = robust_scm2int (end_scm, 0); | 961 int end = robust_scm2int (end_scm, 0); |
956 return internal_skylines_from_element_stencils (me, Y_AXIS, true, beg, end); | 962 return internal_skylines_from_element_stencils (me, Y_AXIS, true, beg, end); |
957 } | 963 } |
LEFT | RIGHT |