Left: | ||
Right: |
OLD | NEW |
---|---|
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) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.org> | 4 Copyright (C) 2000--2015 Jan Nieuwenhuizen <janneke@gnu.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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 | 182 |
183 MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_bracket, 1); | 183 MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_bracket, 1); |
184 SCM | 184 SCM |
185 Arpeggio::brew_chord_bracket (SCM smob) | 185 Arpeggio::brew_chord_bracket (SCM smob) |
186 { | 186 { |
187 Grob *me = unsmob<Grob> (smob); | 187 Grob *me = unsmob<Grob> (smob); |
188 Interval heads = robust_scm2interval (me->get_property ("positions"), | 188 Interval heads = robust_scm2interval (me->get_property ("positions"), |
189 Interval ()) | 189 Interval ()) |
190 * Staff_symbol_referencer::staff_space (me); | 190 * Staff_symbol_referencer::staff_space (me); |
191 | 191 |
192 Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); | 192 Real th |
193 = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")) | |
194 * robust_scm2double (me->get_property ("thickness"), 1); | |
193 Real sp = 1.5 * Staff_symbol_referencer::staff_space (me); | 195 Real sp = 1.5 * Staff_symbol_referencer::staff_space (me); |
194 Real dy = heads.length () + sp; | 196 Real dy = heads.length () + sp; |
195 Real x = robust_scm2double (me->get_property ("protrusion"), 0.4); | 197 Real x = robust_scm2double (me->get_property ("protrusion"), 0.4); |
196 | 198 |
197 Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt)); | 199 Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), th, x, th)); |
198 mol.translate_axis (heads[LEFT] - sp / 2.0, Y_AXIS); | 200 mol.translate_axis (heads[LEFT] - sp / 2.0, Y_AXIS); |
199 return mol.smobbed_copy (); | 201 return mol.smobbed_copy (); |
200 } | 202 } |
201 | 203 |
202 MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_slur, 1); | 204 MAKE_SCHEME_CALLBACK (Arpeggio, brew_chord_slur, 1); |
203 SCM | 205 SCM |
204 Arpeggio::brew_chord_slur (SCM smob) | 206 Arpeggio::brew_chord_slur (SCM smob) |
205 { | 207 { |
206 Grob *me = unsmob<Grob> (smob); | 208 Grob *me = unsmob<Grob> (smob); |
207 SCM dash_definition = me->get_property ("dash-definition"); | 209 SCM dash_definition = me->get_property ("dash-definition"); |
208 Interval heads = robust_scm2interval (me->get_property ("positions"), | 210 Interval heads = robust_scm2interval (me->get_property ("positions"), |
209 Interval ()) | 211 Interval ()) |
210 * Staff_symbol_referencer::staff_space (me); | 212 * Staff_symbol_referencer::staff_space (me); |
211 | 213 |
212 Real lt = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); | 214 Real lt |
Carl
2017/08/01 12:45:59
I think lt should just be line-thickness, and th s
| |
215 = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")) | |
216 * robust_scm2double (me->get_property ("line-thickness"), 1.0); | |
217 Real th | |
218 = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness")) | |
219 * robust_scm2double (me->get_property ("thickness"), 1.0); | |
213 Real dy = heads.length (); | 220 Real dy = heads.length (); |
214 | 221 |
215 Real height_limit = 1.5; | 222 Real height_limit = 1.5; |
216 Real ratio = .33; | 223 Real ratio = .33; |
217 Bezier curve = slur_shape (dy, height_limit, ratio); | 224 Bezier curve = slur_shape (dy, height_limit, ratio); |
218 curve.rotate (90.0); | 225 curve.rotate (90.0); |
219 | 226 |
220 Stencil mol (Lookup::slur (curve, lt, lt, dash_definition)); | 227 Stencil mol (Lookup::slur (curve, th, lt, dash_definition)); |
221 mol.translate_axis (heads[LEFT], Y_AXIS); | 228 mol.translate_axis (heads[LEFT], Y_AXIS); |
222 return mol.smobbed_copy (); | 229 return mol.smobbed_copy (); |
223 } | 230 } |
224 | 231 |
225 /* | 232 /* |
226 We have to do a callback, because print () triggers a | 233 We have to do a callback, because print () triggers a |
227 vertical alignment if it is cross-staff. | 234 vertical alignment if it is cross-staff. |
228 */ | 235 */ |
229 MAKE_SCHEME_CALLBACK (Arpeggio, width, 1); | 236 MAKE_SCHEME_CALLBACK (Arpeggio, width, 1); |
230 SCM | 237 SCM |
(...skipping 13 matching lines...) Expand all Loading... | |
244 | 251 |
245 return Grob::stencil_height (smob); | 252 return Grob::stencil_height (smob); |
246 } | 253 } |
247 | 254 |
248 ADD_INTERFACE (Arpeggio, | 255 ADD_INTERFACE (Arpeggio, |
249 "Functions and settings for drawing an arpeggio symbol.", | 256 "Functions and settings for drawing an arpeggio symbol.", |
250 | 257 |
251 /* properties */ | 258 /* properties */ |
252 "arpeggio-direction " | 259 "arpeggio-direction " |
253 "dash-definition " // TODO: make apply to non-slur arpeggios | 260 "dash-definition " // TODO: make apply to non-slur arpeggios |
261 "line-thickness " | |
Carl
2017/08/01 12:45:59
I think that only thickness should be added
| |
254 "positions " | 262 "positions " |
255 "protrusion " | 263 "protrusion " |
256 "script-priority " // TODO: make around-note-interface | 264 "script-priority " // TODO: make around-note-interface |
257 "stems " | 265 "stems " |
266 "thickness " | |
258 ); | 267 ); |
259 | 268 |
OLD | NEW |